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.

datepart.js 699B

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. class DatePart {
  3. constructor({
  4. token,
  5. date,
  6. parts,
  7. locales
  8. }) {
  9. this.token = token;
  10. this.date = date || new Date();
  11. this.parts = parts || [this];
  12. this.locales = locales || {};
  13. }
  14. up() {}
  15. down() {}
  16. next() {
  17. const currentIdx = this.parts.indexOf(this);
  18. return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
  19. }
  20. setTo(val) {}
  21. prev() {
  22. let parts = [].concat(this.parts).reverse();
  23. const currentIdx = parts.indexOf(this);
  24. return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
  25. }
  26. toString() {
  27. return String(this.date);
  28. }
  29. }
  30. module.exports = DatePart;