I have troubles displaying the month of the following operation in German:
var date = moment.unix(valueTimestamp).format("DD. MMMM YYYY");
I have tried the following, but it does NOT work:
// Attempt #1:
var date = moment.lang('de').unix(valueTimestamp).format("DD. MMMM YYYY");
// Attempt #2:
var date = moment.local('de').unix(valueTimestamp).format("DD. MMMM YYYY");
How do I achieve that the month name will be German?
EDIT
I included the locales.js file and create a js fiddle which will demonstrate my problem:
https://jsfiddle.net/e3a7bgLu/
The console displays the following error:
Uncaught TypeError: moment.locale(...).unix is not a function
You have the unix constructor AFTER you are defining a locale.. So you're defining a locale onto nothing.
You need to create the moment first before defining a locale.
So moment will be created from the
.unix()
method, and from this returned result, you can define a locale onto it.Should do the trick! :)
JSFiddle