Skip to content

Instantly share code, notes, and snippets.

@Nasawa
Last active July 9, 2018 13:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nasawa/78500b7bd0933b9e3d2228a6ade1e586 to your computer and use it in GitHub Desktop.
Save Nasawa/78500b7bd0933b9e3d2228a6ade1e586 to your computer and use it in GitHub Desktop.
Experimental Hain plugin to quickly convert Timestamps
'use strict';
module.exports = (pluginContext) =>
{
function search(query, res)
{
var d = new Date(query * 1000);
res.add(
{
id: '1',
payload: query,
title: `Timestamp: ${query}`,
desc: `<b>${d.toGMTString()}</b>`
});
}
return { search };
};
{
"name": "hain-plugin-timestamp",
"version": "1.0.2",
"description": "Hain plugin to convert timestamps easily",
"main": "index.js",
"keywords": [
"hain-0.1.0",
"hain",
"timestamp",
"hain-plugin-timestamp"
],
"hain": {
"prefix": "/timestamp",
"usage": "enter /timestamp then a timestamp to convert",
"icon": "#fa fa-clock-o",
"redirect": "/g"
},
"author": "Nasawa",
"license": "ISC"
}
@popstas
Copy link

popstas commented Jul 9, 2018

@Nasawa, "redirect": "/g" should be replaced to "redirect": "/time/timstamp " for working "/time [tab]", can you update npm package if you still using Hain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment