完善pomelo客户端

This commit is contained in:
leo
2018-08-22 10:57:12 +08:00
parent cd8aa7d6c5
commit 821a8f550d
47 changed files with 4468 additions and 322 deletions

View File

@@ -0,0 +1,25 @@
function TimeUtil() {
console.log('TimeUtil');
}
//pads n with zeros on the left,
//digits is minimum length of output
//zeroPad(3, 5); returns "005"
//zeroPad(2, 500); returns "500"
function zeroPad(digits, n) {
n = n.toString();
while (n.length < digits)
n = '0' + n;
return n;
};
//it is almost 8 o'clock PM here
//timeString(new Date); returns "19:49"
TimeUtil.prototype.timeString = function (date) {
console.log('timeString');
var minutes = date.getMinutes().toString();
var hours = date.getHours().toString();
return zeroPad(2, hours) + ":" + zeroPad(2, minutes);
};
module.exports = new TimeUtil();

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "04425e17-a421-408e-8891-81835fce9781",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}