Skip to content

Instantly share code, notes, and snippets.

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 jyt/147092 to your computer and use it in GitHub Desktop.
Save jyt/147092 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
names: ['show time in','time'],
author: {name:"jyoti", email: "mail2jyoti88@gmail.com"},
description:"It will show the current time in the place you specified.",
arguments: [ {role: 'object', nountype: noun_arb_text, label: 'name of a place'}],
_time: function(term)
{
return "http://www.timeanddate.com/worldclock/results.html?query="+term;
},
preview: function(pblock,args)
{
var msg="It will show the current time in "+ args.object.text;
pblock.innerHTML=msg;
},
execute: function(args)
{
if (args.text=="")
{
displayMessage("enter name of the place whose current time u want to know");
}
else
Utils.openUrlInBrowser(this._time(args.object.text));
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment