Skip to content

Instantly share code, notes, and snippets.

@zvoase
Created October 23, 2008 21:26
Show Gist options
  • Save zvoase/19217 to your computer and use it in GitHub Desktop.
Save zvoase/19217 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "now",
_now: function(){
var date = new Date();
return date.toLocaleFormat("%A, %B %e %Y, %H:%M");
},
preview: function( pblock ) {
var msg = 'Inserts the current date and time: "<i>${timestamp}</i>"';
pblock.innerHTML = CmdUtils.renderTemplate( msg, {timestamp: this._now()} );
},
execute: function() {
CmdUtils.setSelection( this._now() );
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment