Add language support to represent the current date and time #40
Labels
assigned
Somebody is working on this issue
enhancement
New feature or request
feedback desired
language
Related to the Concordia Language
Currently, Concordia relies on queries to get the current date, time or datetime. Examples:
Formatted values are also accepted:
Instead, it should support a declaration that produces the value without having to deal with queries.
Proposal
1. Language constructions for date and time
The proposed constructions should consider the property
data type
.For example,
now
for adate
must return the current date, whilenow
for atime
must return the current time.Date constructions
now
current date
today
yesterday
tomorrow
next
+ (week
|month
|year
)Example:
next week
last
+ (week
|month
|year
)Example:
last month
day
|days
|week
|weeks
|year
|years
) + (ago
|ahead
|later
)Example:
2 days ago
Time constructions
now
current time
current
+ (second
|minute
|hour
)second
|seconds
|minute
|minutes
|hour
|hours
) + (ago
|ahead
|later
)Example:
1 second ago
Datetime constructions
current datetime
2. Allow constructions for integer values
Example:
Some Examples
Future work
👉 New Issues may address them.
1. Built-in functions
date()
,time()
, anddatetime()
Both can receive an optional parameter
format
. Its value should default to the UI Element locale's date/time/datetime format, if available in the language (see Add locale support to date and time types #30). Otherwise, the locale defined by the document's language.The parameter
format
should use the PHP format for date and time values.By default,
date()
should return day, month and year. Example for the English locale:12/31/2018
.By default,
time()
should return hour and minute (without second). Example for the Portuguese locale:13:00
.By default,
datetime()
should return day, month, year, hour, minute and second. Example for the English locale:12/31/2018 10:20:30
.2. Allow to use the proposed functions inside declared tables.
3. Allow time zones (as an additional optional parameter for the functions?).
The text was updated successfully, but these errors were encountered: