|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
499 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | const DatePart = require('./datepart');
|
|---|
| 4 |
|
|---|
| 5 | class Minutes extends DatePart {
|
|---|
| 6 | constructor(opts = {}) {
|
|---|
| 7 | super(opts);
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | up() {
|
|---|
| 11 | this.date.setMinutes(this.date.getMinutes() + 1);
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | down() {
|
|---|
| 15 | this.date.setMinutes(this.date.getMinutes() - 1);
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | setTo(val) {
|
|---|
| 19 | this.date.setMinutes(parseInt(val.substr(-2)));
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | toString() {
|
|---|
| 23 | let m = this.date.getMinutes();
|
|---|
| 24 | return this.token.length > 1 ? String(m).padStart(2, '0') : m;
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | module.exports = Minutes; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.