Created
October 23, 2008 21:26
-
-
Save zvoase/19217 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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