{"action":"created","issue":{"url":"https://api.github.com/repos/brandizzi/liferay-portal/issues/124","labels_url":"https://api.github.com/repos/brandizzi/liferay-portal/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/brandizzi/liferay-portal/issues/124/comments","events_url":"https://api.github.com/repos/brandizzi/liferay-portal/issues/124/events","html_url":"https://github.com/brandizzi/liferay-portal/pull/124","id":122722264,"number":124,"title":"[TECHNICAL-SUPPORT] LPS-61389 Events on certain dates are not marked on the mini-calendar","user":{"login":"IstvanD","id":6039187,"avatar_url":"https://avatars.githubusercontent.com/u/6039187?v=3","gravatar_id":"","url":"https://api.github.com/users/IstvanD","html_url":"https://github.com/IstvanD","followers_url":"https://api.github.com/users/IstvanD/followers","following_url":"https://api.github.com/users/IstvanD/following{/other_user}","gists_url":"https://api.github.com/users/IstvanD/gists{/gist_id}","starred_url":"https://api.github.com/users/IstvanD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IstvanD/subscriptions","organizations_url":"https://api.github.com/users/IstvanD/orgs","repos_url":"https://api.github.com/users/IstvanD/repos","events_url":"https://api.github.com/users/IstvanD/events{/privacy}","received_events_url":"https://api.github.com/users/IstvanD/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-17T12:03:45Z","updated_at":"2015-12-17T15:00:48Z","closed_at":"2015-12-17T14:58:22Z","pull_request":{"url":"https://api.github.com/repos/brandizzi/liferay-portal/pulls/124","html_url":"https://github.com/brandizzi/liferay-portal/pull/124","diff_url":"https://github.com/brandizzi/liferay-portal/pull/124.diff","patch_url":"https://github.com/brandizzi/liferay-portal/pull/124.patch"},"body":"Hey Adam,\r\n\r\nCould you please review this pull?\r\n\r\nBecause of the calculation method of minicalendar date ranges, there are some days which will not be marked when events are arranged on these days.\r\n\r\nFor example, if you create events for 2015 March 29, 30 and 31, only March 29 will be marked with the lfr-busy-day CSS class in the mini calendar.\r\n\r\nThis is because March 30 and 31 will fall out of the date range of consideration.\r\nThe date range is calculated as follows:\r\n\r\nstart date = (first day in the month in minicalendar) - (one week)\r\nend date = (start date) + (one month) + (one week)\r\n\r\nTherefore, if we consider the month of March, 2015.\r\n\r\nfirst day in the month in minicalendar = March 1\r\nstart date = (March 1) - (one week) = February 22\r\nend date = (February 22) + (one month) + (one week) = March 29\r\n\r\nSo March 30 and 31 will be out of range!.\r\n\r\nThe code which does this calculation is in view_calendar.jsp\r\n\r\n```\r\nvar miniCalendarStartDate = DateMath.subtract(DateMath.toMidnight(window.<portlet:namespace />miniCalendar.get('date')), DateMath.WEEK, 1);\r\n\r\nvar miniCalendarEndDate = DateMath.add(DateMath.add(miniCalendarStartDate, DateMath.MONTH, 1), DateMath.WEEK, 1);\r\n```\r\n\r\nI modified it to take not miniCalendarStartDate, but the first day in the month as a base in the second formula, So in case of March, both 30 and 31 will be included in the range.\r\n\r\nAccording to my tests, it works well, and hasn't produced any errors.\r\n\r\nThank you if you take a look at it.\r\n\r\nBest regards,\r\nIstván"},"comment":{"url":"https://api.github.com/repos/brandizzi/liferay-portal/issues/comments/165476598","html_url":"https://github.com/brandizzi/liferay-portal/pull/124#issuecomment-165476598","issue_url":"https://api.github.com/repos/brandizzi/liferay-portal/issues/124","id":165476598,"user":{"login":"brandizzi","id":156064,"avatar_url":"https://avatars.githubusercontent.com/u/156064?v=3","gravatar_id":"","url":"https://api.github.com/users/brandizzi","html_url":"https://github.com/brandizzi","followers_url":"https://api.github.com/users/brandizzi/followers","following_url":"https://api.github.com/users/brandizzi/following{/other_user}","gists_url":"https://api.github.com/users/brandizzi/gists{/gist_id}","starred_url":"https://api.github.com/users/brandizzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandizzi/subscriptions","organizations_url":"https://api.github.com/users/brandizzi/orgs","repos_url":"https://api.github.com/users/brandizzi/repos","events_url":"https://api.github.com/users/brandizzi/events{/privacy}","received_events_url":"https://api.github.com/users/brandizzi/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T15:00:48Z","updated_at":"2015-12-17T15:00:48Z","body":"Thanks István! It works very well indeed."}}