-
Notifications
You must be signed in to change notification settings - Fork 41
Locale with moment #10
Comments
Hi, How are you using pikaday-angular ? Bower? Browserify? You can set locale by including the appropriate locale script globally. <script src="angular.js"></script>
<script src="moment.js"></script>
<script src="moment/locale/de.js"></script>
<script src="pikaday-angular.js"></script> Using something like browserify: // main.js
require('angular');
var moment = require('moment');
require('moment/locale/de');
require('pikaday-angular'); There's currently an issue upstream with Pikaday, in that it has moment as a dependency in it's package.json file. You need to delete the moment folder from node_modules for the global moment to be used properly. see Pikaday/Pikaday#299 |
Hey nverba! I first tried with only moment (as the docs there state that English is the default) and then also tried with the en-gb locale. Both still have the YYYY-MM-DD config on my side. Using format obviously works, but that's not using the locale then... |
if you use |
Yup, confirmed. Had to call moment.locale('de') in order to test and add a full month format, but then it seems to work.
|
Hey!
Thanks for a great directive!
Trying to get locale working here. After going through the docs, it seems that moment.js loads the English locale by default.
I have moment.js included in my app, but the date formats that got output are still YYYY-MM-DD. Assuming that these are not the default English locales, how can I get this to work?
Thanks!
The text was updated successfully, but these errors were encountered: