mendhak / waveshare-epaper-display

At-a-glance dashboard for Raspberry Pi with a Waveshare ePaper 7.5 Inch HAT. Date/Time, Weather, Alerts, Google/Outlook Calendar
https://code.mendhak.com/raspberrypi-epaper-dashboard/
452 stars 67 forks source link

Programmatic calendar generation #77

Closed mendhak closed 10 months ago

mendhak commented 10 months ago

Continuation of PR #74

I wanted to respect locales - both day names as well as using locale specific first-day-of-week. Example in US it's Sunday but EU it's Monday but Iran it's Saturday. (Edit: Maldives is Friday!)

Also I used a library drawsvg to draw the month calendar, it's a bit longer code but the SVG is much smaller and potentially the calendar generation code becomes reusable if someone wants to put it in another template.

Have a look at the branch in progress, I think I've managed to replicate what you did: https://github.com/mendhak/waveshare-epaper-display/pull/77/files#diff-c646c4a352115b8c5dda6a5348c6540a2db4f6b8114b64875f9cf36684d78a61

Example with locales:

ko_KR

image

en_US

image

en_GB

image

Just doing a bit more testing and then I should be able to merge it

jasompi commented 10 months ago

I haven't thought about localization. This looks great.