-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Canvas] Added formatnumber and formatdate UIs to sidebar #43059
Conversation
0aad09d
to
9cc87d6
Compare
💔 Build Failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, works great!!
For those testing, here is a little expression to get a date which can be formatted via this new sidebar UI:
date
| math "value - 1000*60*60*7"
| formatdate "dddd, MMMM Do YYYY, h:mm:ss a"
| markdown {context}
| render
7182b64
to
2cbdb75
Compare
💔 Build Failed |
2cbdb75
to
1286127
Compare
💚 Build Succeeded |
Pinging @elastic/kibana-canvas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor thing regarding proptypes. Looks great overall!
}) | ||
).isRequired, | ||
handleSelectChange: PropTypes.func, | ||
handleTextChange: PropTypes.func, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these two props might be out of date
…format-transforms
💚 Build Succeeded |
* Added formatnumber and formatdate transform UIs * Added rounddate transform * Changed default custom format * Changed to UTC date * Fixed ts error * Fixed help text * Added type def for arguments * Added types for tranforms * Added snapshots * Fixed prop
Summary
Closes #23111.
Closes #23112.
This introduces a
dateformat
argument form for the sidebar. It looks identical to thenumberFormat
argument type introduced in #42007 but handles MomentJS formats instead of NumeralJS formats.For expressions that include
formatdate
orrounddate
as one of the functions, this form will appear in the sidebar.Note: Currently the sidebar isn't populated with forms for functions used in sub-expressions, so if you have something like
| mapColumn @timestamp fn={getCell @timestamp | formatdate "MM/DD/YYYY"}
, you won't see this date format form in the sidebar and will still need to change it via the expression editor.Changes:
dateformat
argument typeformatnumber
,formatdate
, androunddate
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Documentation was added for features that require explanation or tutorials- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers