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

Add locale support to date and time types #30

Closed
thiagodp opened this issue Mar 16, 2019 · 3 comments
Closed

Add locale support to date and time types #30

thiagodp opened this issue Mar 16, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request feedback desired language Related to the Concordia Language

Comments

@thiagodp
Copy link
Owner

thiagodp commented Mar 16, 2019

Proposal:

1. New property locale

The property locale would assume the document's language by default.

Usage example:

UI Element: Birth Date
  - data type is date
  - locale is "pt"

Every supported language should define the default formats for:

  • date
  • time
  • datetime

2. New function dtf

NOTE: I'm still not satisfied about using a function. Maybe special characters to denote a different kind of string could fit better.

The function means "date time format".

Currently there is the property format, which defines a UI Element's format using a regular expression. The proposed function aims to facilitate that definition by adopting a simpler format, like the PHP date and time format.

Examples:

UI Element: Birth Date
  - data type is date
  - format is dtf( "d/m/Y" )

UI Element: Meeting Hour
  - data type is time
  - format is dtf( "h:i" )

UI Element: Last Update
  - data type is datetime
  - format is dtf( "d/m/Y h:i:s" )

With the proposal, format should assume the locale's format by default. Example:

UI Element: Birth Date
  - data type is date
# format is dtf( `m/d/Y` ) since the language is English and so is the locale.
@thiagodp thiagodp added enhancement New feature or request language Related to the Concordia Language labels Mar 16, 2019
@thiagodp thiagodp changed the title I18n for date and time values Add i18n support for date and time values Mar 26, 2019
@thiagodp
Copy link
Owner Author

thiagodp commented May 5, 2019

See also #40

@thiagodp thiagodp changed the title Add i18n support for date and time values Add i18n support to date and time values May 25, 2019
@thiagodp thiagodp changed the title Add i18n support to date and time values Add i18n support to UI Elements' date and time types May 25, 2019
@thiagodp thiagodp changed the title Add i18n support to UI Elements' date and time types Add locale support to date and time types May 25, 2019
@thiagodp thiagodp self-assigned this May 25, 2019
@thiagodp
Copy link
Owner Author

thiagodp commented Jun 19, 2020

This feature is being released with Concordia 2. The function dtf was replaced by a new UI Element property called locale format that uses Unicode TR 35 as the date pattern. Example:

UI Element: Start Date
  - locale format is "MM/dd"

The generated value will have only month and day.

@thiagodp
Copy link
Owner Author

Locale property released in 2.0-alpha. Function dtf() is not needed anymore, since language expressions were added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feedback desired language Related to the Concordia Language
Projects
None yet
Development

No branches or pull requests

1 participant