source: frontend/node_modules/prompts/lib/dateparts/seconds.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago

Fix frontend appearance

  • Property mode set to 100644
File size: 497 bytes
RevLine 
[9af201e]1'use strict';
2
3const DatePart = require('./datepart');
4
5class Seconds extends DatePart {
6 constructor(opts={}) {
7 super(opts);
8 }
9
10 up() {
11 this.date.setSeconds(this.date.getSeconds() + 1);
12 }
13
14 down() {
15 this.date.setSeconds(this.date.getSeconds() - 1);
16 }
17
18 setTo(val) {
19 this.date.setSeconds(parseInt(val.substr(-2)));
20 }
21
22 toString() {
23 let s = this.date.getSeconds();
24 return this.token.length > 1 ? String(s).padStart(2, '0') : s;
25 }
26}
27
28module.exports = Seconds;
Note: See TracBrowser for help on using the repository browser.