Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

meridiem.js 421B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. const DatePart = require('./datepart');
  3. class Meridiem extends DatePart {
  4. constructor(opts = {}) {
  5. super(opts);
  6. }
  7. up() {
  8. this.date.setHours((this.date.getHours() + 12) % 24);
  9. }
  10. down() {
  11. this.up();
  12. }
  13. toString() {
  14. let meridiem = this.date.getHours() > 12 ? 'pm' : 'am';
  15. return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;
  16. }
  17. }
  18. module.exports = Meridiem;