mirror of
https://github.com/actions/setup-java.git
synced 2025-04-21 10:26:46 +00:00
Fix.
This commit is contained in:
parent
596a6da241
commit
c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions
28
node_modules/prompts/lib/dateparts/year.js
generated
vendored
Normal file
28
node_modules/prompts/lib/dateparts/year.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
'use strict';
|
||||
|
||||
const DatePart = require('./datepart');
|
||||
|
||||
class Year extends DatePart {
|
||||
constructor(opts={}) {
|
||||
super(opts);
|
||||
}
|
||||
|
||||
up() {
|
||||
this.date.setFullYear(this.date.getFullYear() + 1);
|
||||
}
|
||||
|
||||
down() {
|
||||
this.date.setFullYear(this.date.getFullYear() - 1);
|
||||
}
|
||||
|
||||
setTo(val) {
|
||||
this.date.setFullYear(val.substr(-4));
|
||||
}
|
||||
|
||||
toString() {
|
||||
let year = String(this.date.getFullYear()).padStart(4, '0');
|
||||
return this.token.length === 2 ? year.substr(-2) : year;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Year;
|
Loading…
Add table
Add a link
Reference in a new issue