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

Allow format specifier for all date/time types #34

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

ysangkok
Copy link
Contributor

Schemas

This generalizes the implementation of dayWithFormat as a new function called timeWithFormat.
To improve usability, I've added less polymorphic versions of it like e.g. dayWithFormat, utcTimeWithFormat etc.

In codegen

The previous DateFormat type is unnecessary because there is only one type to choose for dates: Data.Time.Day.
Now that the formatSpecifier is possible for both dates and date-times, it has been moved up to the TypeOptions record.

, deriveClasses : DeriveClasses
}
, default =
{ dateTimeFormat = DateTimeFormat.UTCTime
, dateFormat = DateFormat.ISO8601Date
, formatSpecifier = None Text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unfortunate to lose the the meaning of the default from here.

@ysangkok ysangkok merged commit 9eb6d4b into main Apr 18, 2024
1 check passed
@ysangkok ysangkok deleted the generalize-custom-time branch April 18, 2024 22:02
ysangkok added a commit that referenced this pull request Apr 19, 2024
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.

2 participants