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

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

Fix frontend appearance

  • Property mode set to 100644
File size: 681 bytes
Line 
1'use strict';
2
3class DatePart {
4 constructor({token, date, parts, locales}) {
5 this.token = token;
6 this.date = date || new Date();
7 this.parts = parts || [this];
8 this.locales = locales || {};
9 }
10
11 up() {}
12
13 down() {}
14
15 next() {
16 const currentIdx = this.parts.indexOf(this);
17 return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
18 }
19
20 setTo(val) {}
21
22 prev() {
23 let parts = [].concat(this.parts).reverse();
24 const currentIdx = parts.indexOf(this);
25 return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
26 }
27
28 toString() {
29 return String(this.date);
30 }
31}
32
33module.exports = DatePart;
34
35
Note: See TracBrowser for help on using the repository browser.