Open
Description
When you build Calendars and other Date/Time-Widgets, properties with a date-time
builtin type might be useful.
Here are a few suggestions how a builtin type date-time
could look like:
component Calendar {
in property <date-time> date-time;
}
date-time
should behave similar to a JavaScript Date object with convenience functions:
hours() -> int
,minutes() -> int
,month_name() -> string
to_string(format: string) -> string
:date-time.to_string("DD/MM/YYYY")
,date-time.to_string("hh:mm:ss")
to_locale_string(locale: string) -> string
:
Additionally, there could also be a DateTime
namespace to hold functions to construct date-time
instances:
DateTime.now()
DateTime.new(year: int, month: int, day: int, hours: int, minutes: int, seconds: int)
Comments/Suggestions welcome!