Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatic calendar generation #77

Merged
merged 9 commits into from
Jan 21, 2024
Merged

Programmatic calendar generation #77

merged 9 commits into from
Jan 21, 2024

Conversation

mendhak
Copy link
Owner

@mendhak mendhak commented Jan 21, 2024

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

@mendhak mendhak marked this pull request as ready for review January 21, 2024 12:00
@jasompi
Copy link
Contributor

jasompi commented Jan 21, 2024

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

@mendhak mendhak merged commit 271e26c into master Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants