{"action":"created","issue":{"url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/31","labels_url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/31/comments","events_url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/31/events","html_url":"https://github.com/jalaali/moment-jalaali/issues/31","id":77671466,"number":31,"title":"Dynamic calendar system","user":{"login":"Fardinak","id":768703,"avatar_url":"https://avatars.githubusercontent.com/u/768703?v=3","gravatar_id":"","url":"https://api.github.com/users/Fardinak","html_url":"https://github.com/Fardinak","followers_url":"https://api.github.com/users/Fardinak/followers","following_url":"https://api.github.com/users/Fardinak/following{/other_user}","gists_url":"https://api.github.com/users/Fardinak/gists{/gist_id}","starred_url":"https://api.github.com/users/Fardinak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fardinak/subscriptions","organizations_url":"https://api.github.com/users/Fardinak/orgs","repos_url":"https://api.github.com/users/Fardinak/repos","events_url":"https://api.github.com/users/Fardinak/events{/privacy}","received_events_url":"https://api.github.com/users/Fardinak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-18T14:13:32Z","updated_at":"2015-10-07T07:36:12Z","closed_at":null,"body":"This is a good library, however we need our application to be a little more dynamic i.e. we need to let the user switch between calendar systems. With the current version of moment-jalaali it is only possible through a lot of conditional development i.e. one needs to check for the flag and call the appropriate method (e.g. year or jYear) with the appropriate arguments (mostly formatting).\r\n\r\nFollowing issue #30 I have a proposal.\r\nI would suggest using a flag as well as the custom methods, so the following conditions would be true:\r\n```javascript\r\nvar dt = new moment(Date.now(), 'll', 'en', moment.SYSTEM.JALALI),\r\n    currentJalaliYear = 1394,\r\n    currentGregorianYear = 2015;\r\n\r\ndt.year() == currentJalaliYear;\r\ndt.format('YYYY') == currentJalaliYear;\r\n\r\ndt.switchSystem(moment.SYSTEM.GREGORIAN); // Changes the calendar system to Gregorian\r\ndt.year() == currentGregorianYear;\r\ndt.format('YYYY') == currentGregorianYear;\r\n\r\ndt.jYear() == currentJalaliYear;\r\ndt.format('jYYYY') == currentJalaliYear;\r\n\r\ndt.gYear() == currentGregorianYear;\r\ndt.format('gYYYY') == currentGregorianYear;\r\n```\r\n\r\nOf course the formatting is just a suggestion which I suspect may even conflict with the *week year* tokens."},"comment":{"url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/comments/146101849","html_url":"https://github.com/jalaali/moment-jalaali/issues/31#issuecomment-146101849","issue_url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/31","id":146101849,"user":{"login":"subjectix","id":8528759,"avatar_url":"https://avatars.githubusercontent.com/u/8528759?v=3","gravatar_id":"","url":"https://api.github.com/users/subjectix","html_url":"https://github.com/subjectix","followers_url":"https://api.github.com/users/subjectix/followers","following_url":"https://api.github.com/users/subjectix/following{/other_user}","gists_url":"https://api.github.com/users/subjectix/gists{/gist_id}","starred_url":"https://api.github.com/users/subjectix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subjectix/subscriptions","organizations_url":"https://api.github.com/users/subjectix/orgs","repos_url":"https://api.github.com/users/subjectix/repos","events_url":"https://api.github.com/users/subjectix/events{/privacy}","received_events_url":"https://api.github.com/users/subjectix/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T07:36:12Z","updated_at":"2015-10-07T07:36:12Z","body":"Yeah it does. but have that flag defaulting to Georgian and keep the `j...` functions (but deprecate them). Don't introduce unnecessary breaking changes. \r\n\r\nI love your library it awesome :D "}}