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.

seconds.js 497B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. const DatePart = require('./datepart');
  3. class Seconds extends DatePart {
  4. constructor(opts={}) {
  5. super(opts);
  6. }
  7. up() {
  8. this.date.setSeconds(this.date.getSeconds() + 1);
  9. }
  10. down() {
  11. this.date.setSeconds(this.date.getSeconds() - 1);
  12. }
  13. setTo(val) {
  14. this.date.setSeconds(parseInt(val.substr(-2)));
  15. }
  16. toString() {
  17. let s = this.date.getSeconds();
  18. return this.token.length > 1 ? String(s).padStart(2, '0') : s;
  19. }
  20. }
  21. module.exports = Seconds;