{"action":"created","issue":{"url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/30","labels_url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/30/comments","events_url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/30/events","html_url":"https://github.com/jalaali/moment-jalaali/issues/30","id":77666770,"number":30,"title":"Infinite loops when extending the library","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":2,"created_at":"2015-05-18T13:57:49Z","updated_at":"2015-05-19T15:08:31Z","closed_at":null,"body":"Hi,\r\nFirst I wanna thank you for the great work. It's really useful.\r\n\r\nI tried to extend the library using the conventional methods of prototyping and came across multiple infinite loops caused by using `this` to access original moment methods line `year`, `month` and `date`. As an example I reffer you to [master/index.js#L578](https://github.com/jalaali/moment-jalaali/blob/master/index.js#L578):\r\n```javascript\r\nj = toJalaali(this.year(), this.month(), this.date())\r\n```\r\nThis makes it impossible to override these methods."},"comment":{"url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/comments/103540494","html_url":"https://github.com/jalaali/moment-jalaali/issues/30#issuecomment-103540494","issue_url":"https://api.github.com/repos/jalaali/moment-jalaali/issues/30","id":103540494,"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},"created_at":"2015-05-19T15:08:31Z","updated_at":"2015-05-19T15:08:31Z","body":"What I need is, as I mentioned in #31, a general method which returns `moment.year()` or `jMoment.jYear()` depending on user configuration.\r\nCorrect me if I got you wrong, but I believe the method you mentioned helps override the `moment.year()` function, which I don't find relevant in any case!"}}