-
Notifications
You must be signed in to change notification settings - Fork 119
Open
Labels
Description
Would be nice to be able to be able to customize createdAt and updatedAt format simply.
The point being to allow user to choose their format according to their need knowing that numeric has faster comparison and better compression and String is usually more readable (if using decent formatting like ISOString).
current definition is:
timestamp: truewe could keep the true with it default toISOString() behavior, and add possibility to define a function:
timestamp: function(date) {
// return desired format
return date.toISOString(); // timezone, current default
}Here is a list of example:
return date.getTime(); // timestamp in ms
return date.getTime() / 1000; // timestamp in s
return parseInt(d.toISOString().split('T')[0].replace(/-/g, '')); // readable int, yyyymmdd
// etc ...Reactions are currently unavailable