Update timestamp formats

This commit is contained in:
Nick O'Leary 2024-03-04 16:51:06 +00:00
parent b50e0533eb
commit 2dcff51125
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 12 additions and 2 deletions

View File

@ -925,6 +925,12 @@
"jsonata": "expression", "jsonata": "expression",
"env": "env variable", "env": "env variable",
"cred": "credential" "cred": "credential"
},
"date": {
"format": {
"timestamp": "milliseconds since epoch",
"object": "JavaScript Date Object"
}
} }
}, },
"editableList": { "editableList": {

View File

@ -414,11 +414,11 @@
icon:"fa fa-clock-o", icon:"fa fa-clock-o",
options:[ options:[
{ {
label: 'timestamp', label: 'milliseconds since epoch',
value: '' value: ''
}, },
{ {
label: 'ISO 8601', label: 'YYYY-MM-DDTHH:mm:ss.sssZ',
value: 'iso' value: 'iso'
}, },
{ {
@ -670,6 +670,10 @@
allOptions.flow.options = contextStoreOptions; allOptions.flow.options = contextStoreOptions;
allOptions.global.options = contextStoreOptions; allOptions.global.options = contextStoreOptions;
} }
// Translate timestamp options
allOptions.date.options.forEach(opt => {
opt.label = RED._("typedInput.date.format." + (opt.value || 'timestamp'), {defaultValue: opt.label})
})
} }
nlsd = true; nlsd = true;
var that = this; var that = this;