klimeryk / recalendar

ReCalendar - highly customizable calendar for ReMarkable tablets
GNU General Public License v3.0
195 stars 23 forks source link

Feature Request: Start the year at a predefined month #4

Closed DutchJoe closed 3 years ago

DutchJoe commented 3 years ago

Many years do not start in January. For college years start in August or September.

I'd would love a configuration option where I can set the first month of the year.

John

klimeryk commented 3 years ago

Thanks for the suggestion! Interesting use case, I haven't thought of it! It should be easy to implement, I think 🤔 Just to be clear: let's say you define that the year starts in August 2021. Then the end of the "year" should be on August 2022? Or December 2021? Or maybe also configurable? ;)

DutchJoe commented 3 years ago

I think it would be fair to say that a "year" always consists of 12 months. Otherwise you will run into all sorts of formatting issues (how would request #2 look like if a year could take 18 months?).

With that said, only a configuration option for the first month would be sufficient. Eg if first month = August 2021, then the calendar would include August 2021 - July 2022.

John

klimeryk commented 3 years ago

Otherwise you will run into all sorts of formatting issues (how would request #2 look like if a year could take 18 months?).

Yup, that was my concern as well. It could be overcome with generating a year overview for each "calendar" year.. but that would probably complicate the logic.

But if it's always 12 months, that's simple to implement - I've done it in https://github.com/klimeryk/recalendar/commit/7dfecd89007aa483e323100c147524b842fb5377 :) 🙌

You can now use the self::MONTH config parameter to set the start month. It's the month number - so for October, you'd use 10, etc. See https://github.com/klimeryk/recalendar/blob/7dfecd89007aa483e323100c147524b842fb5377/config.php#L71-L75

Hope this helps!

DutchJoe commented 3 years ago

Perfect ! Thank you for your quick turnaround time.

John