mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-22 16:40:51 +00:00
25 lines
No EOL
421 B
JavaScript
25 lines
No EOL
421 B
JavaScript
'use strict';
|
|
|
|
const DatePart = require('./datepart');
|
|
|
|
class Meridiem extends DatePart {
|
|
constructor(opts = {}) {
|
|
super(opts);
|
|
}
|
|
|
|
up() {
|
|
this.date.setHours((this.date.getHours() + 12) % 24);
|
|
}
|
|
|
|
down() {
|
|
this.up();
|
|
}
|
|
|
|
toString() {
|
|
let meridiem = this.date.getHours() > 12 ? 'pm' : 'am';
|
|
return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = Meridiem; |