1
0
mirror of https://github.com/actions/setup-python synced 2024-11-30 21:22:28 +08:00
setup-python/node_modules/prompts/dist/dateparts/milliseconds.js
Danny McCormick 39c08a0eaa Initial pass
2019-06-26 21:12:00 -04:00

28 lines
541 B
JavaScript

'use strict';
const DatePart = require('./datepart');
class Milliseconds extends DatePart {
constructor(opts = {}) {
super(opts);
}
up() {
this.date.setMilliseconds(this.date.getMilliseconds() + 1);
}
down() {
this.date.setMilliseconds(this.date.getMilliseconds() - 1);
}
setTo(val) {
this.date.setMilliseconds(parseInt(val.substr(-this.token.length)));
}
toString() {
return String(this.date.getMilliseconds()).padStart(4, '0').substr(0, this.token.length);
}
}
module.exports = Milliseconds;