{"action":"created","issue":{"url":"https://api.github.com/repos/moment/moment/issues/2267","labels_url":"https://api.github.com/repos/moment/moment/issues/2267/labels{/name}","comments_url":"https://api.github.com/repos/moment/moment/issues/2267/comments","events_url":"https://api.github.com/repos/moment/moment/issues/2267/events","html_url":"https://github.com/moment/moment/issues/2267","id":60234452,"number":2267,"title":"The documentation is incorrect for getting a month name using locale data.","user":{"login":"radakovich","id":6314360,"avatar_url":"https://avatars.githubusercontent.com/u/6314360?v=3","gravatar_id":"","url":"https://api.github.com/users/radakovich","html_url":"https://github.com/radakovich","followers_url":"https://api.github.com/users/radakovich/followers","following_url":"https://api.github.com/users/radakovich/following{/other_user}","gists_url":"https://api.github.com/users/radakovich/gists{/gist_id}","starred_url":"https://api.github.com/users/radakovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radakovich/subscriptions","organizations_url":"https://api.github.com/users/radakovich/orgs","repos_url":"https://api.github.com/users/radakovich/repos","events_url":"https://api.github.com/users/radakovich/events{/privacy}","received_events_url":"https://api.github.com/users/radakovich/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-08T00:55:27Z","updated_at":"2015-03-08T01:17:13Z","closed_at":"2015-03-08T01:17:13Z","body":"In the [Changing locales locally](http://momentjs.com/docs/#/i18n/instance-locale/) section of the documentation, there is an error in the following code:\r\n\r\n```\r\nvar fr = moment().locale('fr');\r\nfr.locale().months(moment([2012, 0])) // \"janvier\"\r\nfr.locale('en');\r\nfr.locale().months(moment([2012, 0])) // \"January\"\r\n```\r\n\r\nThe call to `fr.locale()` in `fr.locale().months(moment([2012, 0]))` returns the string `'fr'`, not the locale data.\r\n\r\nIt should be changed to, from what I can gather, the following:\r\n\r\n```\r\nvar fr = moment().locale('fr');\r\nfr.localeData().months(moment([2012, 0])) // \"janvier\"\r\nfr.locale('en');\r\nfr.localeData().months(moment([2012, 0])) // \"January\"\r\n```\r\n\r\n[Here](http://jsfiddle.net/f8qb01rp/1/) is a link to a JSFiddle showing the issue.\r\n\r\nI would be happy to update the docs, but I don't think I can.  "},"comment":{"url":"https://api.github.com/repos/moment/moment/issues/comments/77726531","html_url":"https://github.com/moment/moment/issues/2267#issuecomment-77726531","issue_url":"https://api.github.com/repos/moment/moment/issues/2267","id":77726531,"user":{"login":"radakovich","id":6314360,"avatar_url":"https://avatars.githubusercontent.com/u/6314360?v=3","gravatar_id":"","url":"https://api.github.com/users/radakovich","html_url":"https://github.com/radakovich","followers_url":"https://api.github.com/users/radakovich/followers","following_url":"https://api.github.com/users/radakovich/following{/other_user}","gists_url":"https://api.github.com/users/radakovich/gists{/gist_id}","starred_url":"https://api.github.com/users/radakovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radakovich/subscriptions","organizations_url":"https://api.github.com/users/radakovich/orgs","repos_url":"https://api.github.com/users/radakovich/repos","events_url":"https://api.github.com/users/radakovich/events{/privacy}","received_events_url":"https://api.github.com/users/radakovich/received_events","type":"User","site_admin":false},"created_at":"2015-03-08T01:17:13Z","updated_at":"2015-03-08T01:17:13Z","body":"Sorry, I found the repository for momentjs.com.  There is already an issue for this.  I will fix and put in a pull request."}}