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

Add a localstorage option to change the start of the week (Fixes #589) #818

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MelissaAutumn
Copy link
Member

@MelissaAutumn MelissaAutumn commented Jan 7, 2025

Fixes #589

I was originally going to show every day of the week, but Qalendar only supports sunday and monday 😢

Quick and dirty setting, as I think @devmount is handling pinia store for settings soon.

Screenshot

image

@MelissaAutumn MelissaAutumn requested a review from devmount January 7, 2025 23:22
@MelissaAutumn MelissaAutumn self-assigned this Jan 7, 2025
@MelissaAutumn MelissaAutumn added the l10n update A string has been added or needs updating label Jan 7, 2025
Copy link
Collaborator

@devmount devmount left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this! Works fine for English, but unfortunately doesn't work for other languages... 😅

I added the German translation.

const isoWeekdays = inject(isoWeekdaysKey);

const startOfTheWeek = ref(localStorage?.getItem('startOfTheWeek') ?? isoWeekdays[0].long.toLowerCase());
const availableStartOfTheWeekOptions = computed(() => isoWeekdays.filter((day) => day.long === 'Monday' || day.long === 'Sunday'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work for other languages than English. E.g. when viewing the settings page in German, this array would be empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n update A string has been added or needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the start of the week configurable
2 participants