Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

[ DateTime ] The format parameter being a format string limits the use of creating constants #187

Open
lexidor opened this issue Jul 11, 2021 · 0 comments

Comments

@lexidor
Copy link
Contributor

lexidor commented Jul 11, 2021

I'd like to be able to create a constant with a particular format with a useful name.
TIME_FMT_MYSQL = ...; TIME_FMT_DISPLAY_INTERNATIONAL = ...; TIME_FMT_CLOCK(12|24)H = ...
This is not possible with the current API design.

Alternatives:
I could declare datetime_fmt(DateTime, MyOwnEnum): string; in my own code. Internally switch over the enum and pass the string literal format string.
Clunky, but it works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant