Wiki
Clone wikiadf-builder-java / node-date
Node: date
Description
The date
node displays a date in the user's locale.
Example
Java
p( text("I wrote this on "), date(1690344879000L) );
ADF
{ "type": "paragraph", "content": [ { "type": "text", "text": "I wrote this on " }, { "type": "date", "attrs": { "timestamp": "1690344879000" } } ] }
Result
I wrote this on 26 Jul 2023
Note: This example output is not using AtlasKit to render the date, so while it gives a vague impression of what a "date" is, it does not faithfully reproduce the actual presentation in Atlassian products. This example also has a hardcoded rendering that does not respect the viewer's locale.
Compatibility
Products
Confluence | Jira |
---|---|
✅ | ✅ |
Usage
Marks
Structure
- type -
date
- attrs
- timestamp - string – not empty; milliseconds since
1970-01-01 00:00:00 UTC
1
- timestamp - string – not empty; milliseconds since
-
This library will also accept the date in several other formats for convenience; however, if the value is given as a string that cannot be parsed as a long value, then the behavior is undefined. ↩
Updated