Make 'File > Repair' date and time human-readable
Signed-off-by: codewithvk <vivek.javiya@collabora.com> Change-Id: Ib8b745fd10aca2eea2e829ad42cf1d91f7ff2129
This commit is contained in:
parent
29cfaa7682
commit
6d0b8e7bb1
1 changed files with 9 additions and 1 deletions
|
@ -114,7 +114,7 @@ L.Control.DocumentRepair = L.Control.extend({
|
|||
if (parseInt(actions[iterator].viewId) === this._map._docLayer._viewId) {
|
||||
userName = _('You');
|
||||
}
|
||||
this.createAction(type, actions[iterator].index, actions[iterator].comment, userName, actions[iterator].dateTime);
|
||||
this.createAction(type, actions[iterator].index, actions[iterator].comment, userName, this.transformTimestamp(actions[iterator].dateTime));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -197,6 +197,14 @@ L.Control.DocumentRepair = L.Control.extend({
|
|||
value: index + 1
|
||||
};
|
||||
this._map.sendUnoCommand('.uno:' + action, command, true);
|
||||
},
|
||||
|
||||
// Transform timestamp from ISO8601 to human readable format with Local time
|
||||
transformTimestamp: function (timestamp) {
|
||||
var d = new Date(timestamp.split(',')[0] + 'Z');
|
||||
var dateOptions = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: true };
|
||||
var formattedDateTime = d.toLocaleString(String.locale, dateOptions);
|
||||
return formattedDateTime;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue