1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Started fixing ReactNative app

This commit is contained in:
Laurent Cozic
2017-07-05 21:34:25 +01:00
parent 9d630ab0ca
commit f0a8cbe95d
50 changed files with 12 additions and 153 deletions

View File

@ -0,0 +1,35 @@
import moment from 'moment';
let time = {
unix() {
return Math.floor((new Date()).getTime() / 1000);
},
unixMs() {
return (new Date()).getTime();
},
unixMsToS(ms) {
return Math.floor(ms / 1000);
},
unixMsToIso(ms) {
return moment.unix(ms / 1000).utc().format('YYYY-MM-DDTHH:mm:ss.SSS') + 'Z';
},
msleep(ms) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, ms);
});
},
sleep(seconds) {
return this.msleep(seconds * 1000);
},
}
export { time };