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

feat: Change Datetime Start of the Week #23556

Closed
EinfachHans opened this issue Jul 1, 2021 · 7 comments
Closed

feat: Change Datetime Start of the Week #23556

EinfachHans opened this issue Jul 1, 2021 · 7 comments
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement v6 issues specific to Framework v6

Comments

@EinfachHans
Copy link
Contributor

Feature Request

Ionic version:

[ ] 4.x
[ ] 5.x
[X] 6.x

Describe the Feature Request

For me living in Germany it would be great to be able to change the Start of the Week day as it is Monday for us.

Describe Solutions

  • startOfTheWeek Property
  • automatically by locale if this is possible?
@ionitron-bot ionitron-bot bot added the triage label Jul 1, 2021
@liamdebeasi liamdebeasi added package: core @ionic/core package type: feature request a new feature, enhancement, or improvement labels Jul 1, 2021
@ionitron-bot ionitron-bot bot removed the triage label Jul 1, 2021
@liamdebeasi liamdebeasi added this to the 6.0.0 milestone Jul 1, 2021
@EinfachHans
Copy link
Contributor Author

What would be the preferred implementation here? @liamdebeasi

I guess a Property as it looks like there is no pure js implementation without creating a map for every locale

@liamdebeasi liamdebeasi removed this from the 6.0.0 milestone Jul 6, 2021
@liamdebeasi liamdebeasi added the v6 issues specific to Framework v6 label Jul 6, 2021
@liamdebeasi liamdebeasi added type: feature request a new feature, enhancement, or improvement and removed type: feature request a new feature, enhancement, or improvement labels Jul 16, 2021
@KristjanLaane
Copy link

Yup, our users keep picking the wrong day because they visually pick the first date in the row assuming it is Monday, when in fact it is Sunday in this date picker.

@EinfachHans
Copy link
Contributor Author

I can create a PR, i just don't know what the Ionic Team's preferred Solution is.

Creating a Prop would be the easiest one, but it removes the configuration by locale advantage. But it doesn't look like there is an pure js solutions, so i think the options are:

  • startOfWeek Prop
  • Include a Map with all locales and the startOfWeek Day into Ionic (i personally on't like this one)
  • Include a external library into Ionic (i think they won't like that one)

@liamdebeasi
Copy link
Contributor

I would prefer a startOfWeek property that accepts an integer value corresponding to the first day of the week. This property should default to 0 so the start of the week is Sunday by default.

For example, startOfWeek="2" would make Tuesday the first day of the week.

The definition should look something like this:

@Prop() startOfWeek: number = 0;

It might be worth doing some investigating first to see if we can determine the start of the week automatically. We use this API internally: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat.

@EinfachHans
Copy link
Contributor Author

I found this open Issue so looks like it's not able to determinate automatically currently: tc39/ecma402#6

I will create a PR with a new Property 😊

liamdebeasi added a commit that referenced this issue Aug 17, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #23692, and this feature will be available in an upcoming release of the Ionic Framework v6 beta.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 16, 2021

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement v6 issues specific to Framework v6
Projects
None yet
Development

No branches or pull requests

3 participants