Skip to content

Instantly share code, notes, and snippets.

@Bajena
Created July 10, 2018 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bajena/3192e89be600df52904f9ffd0577e265 to your computer and use it in GitHub Desktop.
Save Bajena/3192e89be600df52904f9ffd0577e265 to your computer and use it in GitHub Desktop.
Date utils for GDS
var DateUtils = {
/*
* Converts Date object to a String containing the date part (with dashes).
*
* @return {String} Date part. E.g. '2018-07-10'.
*/
getDatePart: function(dateObject) {
return dateObject.toISOString().slice(0, 10);
}
}
var module = module || {};
module.exports = DateUtils;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment