Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DateTimePicker update #406

Merged
merged 10 commits into from
Jun 29, 2022
Merged

DateTimePicker update #406

merged 10 commits into from
Jun 29, 2022

Conversation

bdlukaa
Copy link
Owner

@bdlukaa bdlukaa commented Jun 25, 2022

Fixes #306

Pre-launch Checklist

  • I have updated CHANGELOG.md with my changes
  • I have run "dart format ." on the project
  • I have added/updated relevant documentation

bdlukaa added 2 commits June 25, 2022 10:30
and make use of fluent localizations
@bdlukaa
Copy link
Owner Author

bdlukaa commented Jun 26, 2022

The following translations were added

  "hour": "hour",
  "minute": "minute",
  "am": "AM",
  "pm": "PM",
  "month": "month",
  "day": "day",
  "year": "year"

@WinXaito @henry2man @raitonoberu @larsb24 @alexmercerind @zacksleo @dmakwt @xmine64 @patricknicolosi
if you guys could send the translated version of these in your mother language, I'd be so grateful :)

They're basically used as a placeholder when the current selected date is not provided (null)

@alexmercerind
Copy link

  "hour": "घंटा",
  "minute": "मिनट",
  "am": "AM",
  "pm": "PM",
  "month": "महीना",
  "day": "दिन",
  "year": "साल"

Thanks!

@bdlukaa bdlukaa marked this pull request as ready for review June 26, 2022 13:38
@patricknicolosi
Copy link
Contributor

patricknicolosi commented Jun 26, 2022

"IT"

  "hour": "ore",
  "minute": "minuti",
  "am": "AM",
  "pm": "PM",
  "month": "mese",
  "day": "giorno",
  "year": "anno"

@dmakwt
Copy link
Contributor

dmakwt commented Jun 26, 2022

"AR"

  "hour": "ساعة",
  "minute": "دقيقة",
  "am": "AM",
  "pm": "PM",
  "month": "شهر",
  "day": "يوم",
  "year": "سنة"

@xmine64
Copy link
Contributor

xmine64 commented Jun 26, 2022

"FA"

    "hour": "ساعت",
    "minute": "دقیقه",
    "am": "ق.ظ.",
    "pm": "ب.ظ.",
    "month": "ماه",
    "day": "روز",
    "year": "سال"

@henry2man
Copy link
Contributor

Spanish localisation ES:

  "hour": "hora",
  "minute": "minuto",
  "am": "AM",
  "pm": "PM",
  "month": "mes",
  "day": "día",
  "year": "año"

@bdlukaa Relative to hours and minutes, should we use plural literals instead of singular ones?

Just in case, in Latin languages Spanish we just need to add a final s to the literal if needlessly.

@henry2man
Copy link
Contributor

Also, will 24h format be available? In Spanish is not usual to use the AM/PM format, so instead we use 24h one.

@bdlukaa
Copy link
Owner Author

bdlukaa commented Jun 26, 2022

@henry2man

Relative to hours and minutes, should we use plural literals instead of singular ones?

Singular ones. The texts will be used here:


Also, will 24h format be available? In Spanish is not usual to use the AM/PM format, so instead we use 24h one.

It has been available since DateTime pickers were implemented.

Check the example app to play with it!

@WinXaito
Copy link
Collaborator

FR

  "hour": "heure",
  "minute": "minute",
  "am": "AM",
  "pm": "PM",
  "month": "mois",
  "day": "jour",
  "year": "année"

Note: AM and PM are not used in french, we use 24h format. Translation for AM/PM can be matin/après-midi, but I think it's preferable to keep AM/PM.

And the date in french is in format : DAY / MONTH / YEAR, so Day must be before month ;)

@bdlukaa
Copy link
Owner Author

bdlukaa commented Jun 29, 2022

AM and PM are not used in french, we use 24h format

There is already the possibility to use 24h format:

TimePicker(
  hourFormat: HourFormat.H,
),

And the date in french is in format : DAY / MONTH / YEAR, so Day must be before month ;)

This PR adds DatePicker.fieldOrder, which let the dev choose what's the order the fields are displayed. It also adds a new function (getDateOrderFromLocale) that is able to get the date order based on the current locale. It's used by default.

cyan/green/blue - DAY/MONTH/YEAR
yellow - YEAR/MONTH/DAY
red - MONTH/DAY/YEAR

src: https://en.wikipedia.org/wiki/Date_format_by_country

Since most of the world uses the DMY format, it's returned by default!


The year and day fields are also formatted based on the locale.

@bdlukaa bdlukaa merged commit 0511df9 into master Jun 29, 2022
@bdlukaa bdlukaa deleted the pickers-update branch June 29, 2022 21:42
@bdlukaa bdlukaa mentioned this pull request Jun 29, 2022
3 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date Picker - placeholder
7 participants