Last active
July 9, 2018 13:05
-
-
Save Nasawa/78500b7bd0933b9e3d2228a6ade1e586 to your computer and use it in GitHub Desktop.
Experimental Hain plugin to quickly convert Timestamps
This file contains 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
'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 }; | |
}; |
This file contains 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
{ | |
"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" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Nasawa,
"redirect": "/g"
should be replaced to"redirect": "/time/timstamp "
for working "/time [tab]", can you update npm package if you still using Hain?