Skip to content

Instantly share code, notes, and snippets.

@kaugesaar
Last active February 5, 2016 15:55
Show Gist options
  • Save kaugesaar/d1f3e77f1db777c360a7 to your computer and use it in GitHub Desktop.
Save kaugesaar/d1f3e77f1db777c360a7 to your computer and use it in GitHub Desktop.
if(! Date.toAdWordsString) {
Date.prototype.toAdWordsString = function () {
var y = String(this.getFullYear());
var m = this.getMonth() + 1;
var d = this.getDate();
m = (m < 10) ? '0' + m : String(m);
d = (d < 10) ? '0' + d : String(d);
return y + m + d;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment