Given a date, output the X and Y position of the current day of the date on a digital calendar. The digital calendar is sort of the calendar that gets shown when you click on your computers clock (at least on windows), and it looks something like this:
If we assume that the given date is 25.09.2017, the result would be (2,5)
, because the 25th day of the 9th month of this year is in the second column and fifth row.
Note that if the date would be something like 29.08.2017, we couldn't use the calendar from above, but a new one for August. The gray-ish numbers are simply there to fill the gaps until the day that the month actually starts.
Input
A date, in any reasonable format.
Output
The point or coordinates that the day of the given date lies at, in its respective calendar. These should be 1-indexed.
Rules
- This is code-golf, the shortest code in any language wins.
- Standard loopholes are forbidden.
Additional Notes
The first column of the calendar will always be Sunday.
Here are the digital calendars from January and September 2017:
Test Cases
Input: 06.02.2018 (DD.MM.YYYY)
or 2018.02.06 (YYYY.MM.DD)
Output: (3,2)
Input: 12.11.1982 (DD.MM.YYYY)
or 1982.11.12 (YYYY.MM.DD)
Output: (6,2)
Input: 01.01.2030 (DD.MM.YYYY)
or 2030.01.01 (YYYY.MM.DD)
Output: (3,1)
Input: 13.06.3017 (DD.MM.YYYY)
or 3017.06.13 (YYYY.MM.DD)
Output: (6,3)