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

1.0.4 first weekday customization #1

Merged
merged 4 commits into from Jan 2, 2022
Merged

1.0.4 first weekday customization #1

merged 4 commits into from Jan 2, 2022

Conversation

rfm4j
Copy link
Contributor

@rfm4j rfm4j commented Jan 1, 2022

Hi!,

I was using this really cool date picker, and I had the need to change the first week day (now Sunday is shown as the first week day, and I wanted to use Monday as the first)

To do so, I've added a new optional parameter firstWeekDay, with de default value of Sunday.

I'm also thinking about adding a localisation support, but this is not really urgent, since you already support customisations on weekday names and date formats.

Just let me know if I can help with anything else, and congratulations for this great plugin, I really appreciate it.

@rfm4j rfm4j changed the title 1.0.4 fist weekday customization 1.0.4 first weekday customization Jan 1, 2022
@joo6077
Copy link
Owner

joo6077 commented Jan 2, 2022

Thank you for using this plugin! I really appreciate your contribution! It's awesome feature! Actually, I'm also thinking about more localization like presenting date as 2/Jan/2021. But I need to study more and I'm implementing my applications. It could take quite long

Thank you again and Happy New Year!

@joo6077 joo6077 merged commit 322a3d8 into joo6077:master Jan 2, 2022
@joo6077
Copy link
Owner

joo6077 commented Jan 2, 2022

What do you want for the localization support?

@rfm4j
Copy link
Contributor Author

rfm4j commented Jan 2, 2022

Hi!

Happy New Year to you too!

Thank you so much for accepting my PR. I really think you are doing a great job with this pluging, and it's a pleasure to help with anything you need.

Regardless the localization, here is the idea, but its up to you, if you like it we can implement it together.

Let's say we need to support 2 languages, english, and spanish. We could have an additional parameter in the CoolDatepicker class representing the locale we want.

Each locale should support:

  • Differents weekday names (for example, Monday, for english in "M", while in spanish is "Lu")
  • Differents month names (i.e. if we want to have January instead of 01 as month name)
  • Different first week day (for english the week starts on Sunday, while for Spanish it starts on Monday)
  • Differents ways of represent the date

You already support most of this features (in fact, I'm using this), but I would be nice to just provide my locale to the plugin and not having to worry about managing this all the time

I think we could achieve that by having a configuration class, for example, let's asume we support, by default, english and spanish, we could have a map holding

  • Locale("es","ES") -> All the spanish config
  • Locale("en","GB") -> All the english config

And so on (with all the locales we want to support). This could either be provided in a config file, or by code, we would have to think about it.

In addition, we should allow users to provide aditional locales configurations (imagine someone wants to provide a specific locale for Russian for example, or want's to override the Spanish default configuration)

It may be a little mess, idk if I make myself understand.

Let me know anything you need, and again congratulations for this great work, this is, by far, the best calendar plugin I've found in the flutter marketplace, and thank you for sharing it with the community

@rfm4j rfm4j deleted the 1.0.4-fistWeekdayCustomization branch January 2, 2022 18:31
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