Commit 7a11c5e0 authored by Tristan Cavelier's avatar Tristan Cavelier

gidstorage date metadata action added

parent 81842844
...@@ -133,6 +133,25 @@ ...@@ -133,6 +133,25 @@
} }
} }
} }
},
/**
* Returns the metadata if it is a date
*/
date: function (value) {
var d;
if (!Array.isArray(value)) {
if (typeof value === 'object') {
d = new Date(value.content);
value = value.content;
} else {
d = new Date(value);
}
}
if (Object.prototype.toString.call(d) === "[object Date]") {
if (!isNaN(d.getTime())) {
return value;
}
}
} }
}; };
content_type_re = content_type_re =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment