Merge pull request 'fix(util_log): refs #7268 fix getChanges when is datestring' (!2370) from 7268-hotFix_getChanges_datestring into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2370 Reviewed-by: Juan Ferrer <juan@verdnatura.es>
This commit is contained in:
commit
c071005a9e
|
@ -85,8 +85,12 @@ exports.translateValues = async(instance, changes, options = {}) => {
|
||||||
exports.getChanges = (original, changes) => {
|
exports.getChanges = (original, changes) => {
|
||||||
const oldChanges = {};
|
const oldChanges = {};
|
||||||
const newChanges = {};
|
const newChanges = {};
|
||||||
|
const dateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
||||||
|
|
||||||
for (let property in changes) {
|
for (let property in changes) {
|
||||||
|
if (dateRegex.test(original[property]))
|
||||||
|
original[property] = new Date(Date.parse(original[property]));
|
||||||
|
|
||||||
const firstChar = property.substring(0, 1);
|
const firstChar = property.substring(0, 1);
|
||||||
const isPrivate = firstChar == '$';
|
const isPrivate = firstChar == '$';
|
||||||
if (isPrivate) return;
|
if (isPrivate) return;
|
||||||
|
|
Loading…
Reference in New Issue