-
Notifications
You must be signed in to change notification settings - Fork 19
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
cc-input-date: init component #842
Comments
pdesoyres-cc
added a commit
that referenced
this issue
Sep 26, 2023
pdesoyres-cc
added a commit
that referenced
this issue
Sep 26, 2023
pdesoyres-cc
added a commit
that referenced
this issue
Sep 26, 2023
pdesoyres-cc
added a commit
that referenced
this issue
Sep 26, 2023
pdesoyres-cc
added a commit
that referenced
this issue
Oct 27, 2023
pdesoyres-cc
added a commit
that referenced
this issue
Nov 2, 2023
pdesoyres-cc
added a commit
that referenced
this issue
Nov 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
For the logs page of the Console, we want to let the users choose the date range for which they want to see the logs.
For that, we need an input that lets them specify a date.
Date format
The component allows two formats:
simple format
:YYYY-MM-DD HH:mm:ss
ISO format
:YYYY-MM-DDTHH:mm:ss.SSSZ
The users can type a date in either the
simple format
or theISO format
.As soon as a typed date respects one of the two formats it is automatically formatted with the simple format (no need to blur or to type Enter key).
As a developer, one can pass a value with either a
Date
, a string inISO format
, or a string insimple format
.milliseconds precision
The component keeps track of the milliseconds part when users provide a
Date
or a string inISO format
Then, when the date is changed by editing the input using the
simple format
, users don't need to specify the milliseconds because it is not part of this format.However, we don't want to lose the initial milliseconds precision.
The component will use the initial milliseconds part that has been stored initially to reconstruct a full date with milliseconds precision.
To be discussed
Should we consider this component as an atomic component? Or should we consider it as bound to the logs page and to be a very specialized component?
Inputs
Attributes/properties
disabled
boolean
false
false
inline
boolean
false
false
label
string
null
true
hiddenLabel
boolean
false
false
max
string
null
false
min
string
null
false
name
string
null
false
readonly
boolean
false
false
required
boolean
false
false
skeleton
boolean
false
false
value
string|Date
null
false
timezone
Timezone
UTC
false
Slots
error
help
CSS custom property
--cc-input-font-family
FontFamily
var(--cc-ff-monospace, monospace)
Outputs
input
string
requestimplicitsubmit
Note that, the
input
event is dispatched even if the input date is not valid:Type Definitions
Public methods
getValueAsDate()
: returns the value as aDate
ornull
if the input date is not valid.validate()
: returns whereas the input is valid regarding:required
istrue
.YYYY-MM-DD HH:mm:ss
).min
.max
.The text was updated successfully, but these errors were encountered: