mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add local time display option to numerics in debug window
This commit is contained in:
parent
5110eaff96
commit
c409af0ea8
@ -192,6 +192,14 @@ RED.utils = (function() {
|
||||
format = 'hex'
|
||||
}
|
||||
} else if (format === 'dateMS' || format == 'dateS') {
|
||||
if ((obj.toString().length===13) && (obj<=2147483647000)) {
|
||||
format = 'dateML';
|
||||
} else if ((obj.toString().length===10) && (obj<=2147483647)) {
|
||||
format = 'dateL';
|
||||
} else {
|
||||
format = 'hex'
|
||||
}
|
||||
} else if (format === 'dateML' || format == 'dateL') {
|
||||
format = 'hex';
|
||||
} else {
|
||||
format = 'dec';
|
||||
@ -210,6 +218,12 @@ RED.utils = (function() {
|
||||
element.text((new Date(obj)).toISOString());
|
||||
} else if (format === 'dateS') {
|
||||
element.text((new Date(obj*1000)).toISOString());
|
||||
} else if (format === 'dateML') {
|
||||
var dd = new Date(obj);
|
||||
element.text(dd.toLocaleString() + " [UTC" + ( dd.getTimezoneOffset()/-60 <=0?"":"+" ) + dd.getTimezoneOffset()/-60 +"]");
|
||||
} else if (format === 'dateL') {
|
||||
var ddl = new Date(obj*1000);
|
||||
element.text(ddl.toLocaleString() + " [UTC" + ( ddl.getTimezoneOffset()/-60 <=0?"":"+" ) + ddl.getTimezoneOffset()/-60 +"]");
|
||||
} else if (format === 'hex') {
|
||||
element.text("0x"+(obj).toString(16));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user