Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate langData objects on the moment namespace. #334

Closed
timrwood opened this issue Jun 11, 2012 · 6 comments
Closed

Deprecate langData objects on the moment namespace. #334

timrwood opened this issue Jun 11, 2012 · 6 comments

Comments

@timrwood
Copy link
Member

All of these are going away in 2.0.0.

moment.calendar
moment.relativeTime
moment.months
moment.monthsShort
moment.monthsMin
moment.weekdays
moment.weekdaysShort
moment.longDateFormat
moment.meridiem
moment.ordinal

They are going to be replaced by moment.langData().calendar or moment.langData('en').calendar.

@rockymeza
Copy link
Contributor

For future reference, see the discussion in #332.

@timrwood
Copy link
Member Author

timrwood commented Jul 5, 2012

TODO reminder: We will need to undo c018776 when we drop the accessors from the global object.

@rockymeza
Copy link
Contributor

also preparse and postformat

@timrwood
Copy link
Member Author

This has been deprecated in the develop branch, so I'm closing this issue.

@giulianob
Copy link

In the previous version I was able to do the following to get an array with all of the months:

moment.langData().monthsShort

but now it looks like monthsShort is a function which takes in a moment obj. Is it still possible somehow to get the list of months as an array?

@timrwood
Copy link
Member Author

You can use moment.langData()._monthsShort, but that won't really work for all languages, so it's probably better to use a solution like the one in this comment.

moment.langData().monthsShort(moment([0, monthIndex]), "");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants