{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/calendar/issues/596","repository_url":"https://api.github.com/repos/owncloud/calendar","labels_url":"https://api.github.com/repos/owncloud/calendar/issues/596/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/calendar/issues/596/comments","events_url":"https://api.github.com/repos/owncloud/calendar/issues/596/events","html_url":"https://github.com/owncloud/calendar/pull/596","id":162327486,"number":596,"title":"Cast firstDay input to number for moment >=2.11","user":{"login":"peternowee","id":10220583,"avatar_url":"https://avatars.githubusercontent.com/u/10220583?v=3","gravatar_id":"","url":"https://api.github.com/users/peternowee","html_url":"https://github.com/peternowee","followers_url":"https://api.github.com/users/peternowee/followers","following_url":"https://api.github.com/users/peternowee/following{/other_user}","gists_url":"https://api.github.com/users/peternowee/gists{/gist_id}","starred_url":"https://api.github.com/users/peternowee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peternowee/subscriptions","organizations_url":"https://api.github.com/users/peternowee/orgs","repos_url":"https://api.github.com/users/peternowee/repos","events_url":"https://api.github.com/users/peternowee/events{/privacy}","received_events_url":"https://api.github.com/users/peternowee/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/calendar/labels/3%20-%20to%20review","name":"3 - to review","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-26T13:19:47Z","updated_at":"2016-07-09T12:35:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/owncloud/calendar/pulls/596","html_url":"https://github.com/owncloud/calendar/pull/596","diff_url":"https://github.com/owncloud/calendar/pull/596.diff","patch_url":"https://github.com/owncloud/calendar/pull/596.patch"},"body":"Starting with moment.js 2.11.0, the first day of the week (`dow`) needs to be supplied as a number type (e.g. `0` for Sunday). Supplying a string (e.g. `\"0\"` for Sunday) will result in incorrect week number calculation. This Calendar app sets FullCalendar's `firstDay` option, which in turn sets moment.js' `dow`.\r\n\r\nBoth moment.js and FullCalendar have indicated that they will not be accepting or sanitizing strings (see moment/moment#2900 and fullcalendar/fullcalendar#3014).\r\n\r\nNote that FullCalendar is supplied by this Calendar app, but that moment.js is supplied by core. Both ownCloud core and Nextcloud core currently still depend on moment 2.10.\r\n\r\nAlso note that week number functionality for this Calendar app is still under development (see owncloud/calendar#262).\r\n\r\nHowever, when using the week number functionality in combination with a manual upgrade of core's moment to version 2.13.0, week numbers were indeed calculated incorrectly. Screenshots:\r\n\r\nWeek numbers + moment 2.13.0, week numbers incorrect:\r\n![20160626 oc 3d65979 cal c9050e7 pn test-fc-weeknr 63a0b26 fc 4eef482 pn weeknr-in-daycell d9c2dd8 moment 2 13 0 week numbers wrong](https://cloud.githubusercontent.com/assets/10220583/16362521/2254de4e-3bb1-11e6-94c1-d4a394524c81.png)\r\n\r\nWeek numbers + moment 2.13.0 + this fix, week numbers correct again:\r\n![20160626 oc 3d65979 cal c9050e7 pn test-fc-weeknr 63a0b26 fc 4eef482 pn weeknr-in-daycell d9c2dd8 moment 2 13 0 week numbers fixed](https://cloud.githubusercontent.com/assets/10220583/16362522/23d061b2-3bb1-11e6-8491-19d7d1c0dc07.png)\r\n\r\nThis commit contains a preventive fix that adds unary plusses to the input for FullCalendar's `firstDay` option, so that any string is cast to number. It can be applied now already and will prevent problems when core upgrades its moment.js dependency to a higher version."},"comment":{"url":"https://api.github.com/repos/owncloud/calendar/issues/comments/231532378","html_url":"https://github.com/owncloud/calendar/pull/596#issuecomment-231532378","issue_url":"https://api.github.com/repos/owncloud/calendar/issues/596","id":231532378,"user":{"login":"georgehrke","id":1250540,"avatar_url":"https://avatars.githubusercontent.com/u/1250540?v=3","gravatar_id":"","url":"https://api.github.com/users/georgehrke","html_url":"https://github.com/georgehrke","followers_url":"https://api.github.com/users/georgehrke/followers","following_url":"https://api.github.com/users/georgehrke/following{/other_user}","gists_url":"https://api.github.com/users/georgehrke/gists{/gist_id}","starred_url":"https://api.github.com/users/georgehrke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgehrke/subscriptions","organizations_url":"https://api.github.com/users/georgehrke/orgs","repos_url":"https://api.github.com/users/georgehrke/repos","events_url":"https://api.github.com/users/georgehrke/events{/privacy}","received_events_url":"https://api.github.com/users/georgehrke/received_events","type":"User","site_admin":false},"created_at":"2016-07-09T12:35:35Z","updated_at":"2016-07-09T12:35:35Z","body":"I think `+...` is a bit hacky. Does this work in all major browsers?\r\n\r\nWhat do you think about using `parseInt` instead?"}}
{"actor":{"display_login":"georgehrke"}}