Skip to content

How to change the locale startOfweek ? #272

Answered by jama5262
abdullah-cse asked this question in Q&A
Discussion options

You must be logged in to vote

As of version 6.4.0, you can now override locale settings

So to override the start of week, simply do the following

await Jiffy.setLocale(locale: 'en_US');

final jiffy = Jiffy.now().locale.startOfWeek; // Sunday

// Overriding the start of week
await Jiffy.setLocale(
    locale: 'en_US',
    startOfWeek: StartOFWeek.saturday,
);

final jiffy = Jiffy.now().locale.startOfWeek; // Saturday

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jama5262
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants