Skip to content

Use the Locale on date-fns functions #39

@tomchentw

Description

@tomchentw

Issue

#38 is a good demonstration for this bug. If I change locale to the one that has Monday as their first day of the week, the calendar will not respect that. Eg. Italian locale https://github.com/date-fns/date-fns/blob/v2.25.0/src/locale/it/index.js

JPEG-1

Has an options.weekStartsOn = 1. With #38, it gives:

JPEG-2

Where Dom (domenica) is Sunday in Italian and Lun (lunedì) is Monday in Italina

Solution

Whenever date-fns functions are used, they should given the locale object.
https://date-fns.org/v2.28.0/docs/Locale

I will see if I could submit a PR for this. Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions