A generic date picker that can be used several times with different configurations.
The plugin provides a simple configurable date/time plugin for use in different situations where one or more dates and/or times need to be added as metadata.
Dates should be stored using itemMetaExtProperty (child element of itemMeta) element. E.g. below
The DatePicker plugin can be instantiated multiple times, one for each date used in the metadata.
Below is a configuration example that uses 3 dates: a print publication date, without time information, an approval date and time, and a start time. Note that the name must be the same for all instances, and the id is different for each instance. The url is made unique by adding a unique instance number.
{
"plugins": [
{
"id": "io.infomaker.datepicker.printpubdate",
"name": "im-datepicker",
"url": "https://plugins.writer.infomaker.io/v1/infomaker/im-datepicker/{PLUGIN_VERSION}/index.js",
"style": "https://plugins.writer.infomaker.io/v1/infomaker/im-datepicker/{PLUGIN_VERSION}/style.css",
"enabled": true,
"mandatory": false,
"data": {
"label": "Print Publishing Date",
"type": "printpubdate",
"mode": "date"
}
},
{
"id": "io.infomaker.datepicker.approvalpubdate",
"name": "im-datepicker",
"url": "https://plugins.writer.infomaker.io/v1/infomaker/im-datepicker/{PLUGIN_VERSION}/index.js",
"style": "https://plugins.writer.infomaker.io/v1/infomaker/im-datepicker/{PLUGIN_VERSION}/style.css",
"enabled": true,
"mandatory": false,
"data": {
"label": "Approval Date",
"type": "approvalpubdate",
"mode": "datetime"
}
},
{
"id": "io.infomaker.datepicker.starttime",
"name": "im-datepicker",
"url": "https://plugins.writer.infomaker.io/v1/infomaker/im-datepicker/{PLUGIN_VERSION}/index.js",
"style": "https://plugins.writer.infomaker.io/v1/infomaker/im-datepicker/{PLUGIN_VERSION}/style.css",
"enabled": true,
"mandatory": false,
"data": {
"label": "Start Time",
"type": "starttime",
"mode": "time"
}
}
]
}
Property | Type | Required | Description |
---|---|---|---|
label | String | true |
The label to be displayed in the Digital Writer sidebar |
type | String | true |
Specify the type that will be used to get/set dates to and from the XML (will be prepended with imext: ) |
mode | String | true |
Specify what format to use for the plugin. Valid options are: time , date or datetime |
The plugin generates the XML output described below. Note that the second part of the type
attribute is configured in the plugin. By convention, the type is set as x:y
, with x
indicating that this is an extension (imext
), and y
being the value set in the plugin configuration listed above.
The date format is stored as ISO 8601.
<newsItem>
<itemMeta>
<itemMetaExtProperty type="imext:printpubdate" value="2019-03-21"/>
<itemMetaExtProperty type="imext:starttime" value="23:59+01:00"/>
<itemMetaExtProperty type="imext:approvalpubdate" value="2019-03-08T10:59:00+01:00"/>
</itemMeta>
</newsItem>