Ohm-Management - Projektarbeit B-ME
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.

calendar-base.js 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _mixins = require('../../../util/mixins');
  6. var _mixins2 = _interopRequireDefault(_mixins);
  7. var _themeable = require('../../../mixins/themeable');
  8. var _themeable2 = _interopRequireDefault(_themeable);
  9. var _colorable = require('../../../mixins/colorable');
  10. var _colorable2 = _interopRequireDefault(_colorable);
  11. var _times = require('./times');
  12. var _times2 = _interopRequireDefault(_times);
  13. var _mouse = require('./mouse');
  14. var _mouse2 = _interopRequireDefault(_mouse);
  15. var _props = require('../util/props');
  16. var _props2 = _interopRequireDefault(_props);
  17. var _timestamp = require('../util/timestamp');
  18. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  19. /* @vue/component */
  20. // Util
  21. exports.default = (0, _mixins2.default)(_colorable2.default, _themeable2.default, _times2.default, _mouse2.default).extend({
  22. name: 'calendar-base',
  23. props: _props2.default.base,
  24. computed: {
  25. weekdaySkips: function weekdaySkips() {
  26. return (0, _timestamp.getWeekdaySkips)(this.weekdays);
  27. },
  28. parsedStart: function parsedStart() {
  29. return (0, _timestamp.parseTimestamp)(this.start);
  30. },
  31. parsedEnd: function parsedEnd() {
  32. return (0, _timestamp.parseTimestamp)(this.end);
  33. },
  34. days: function days() {
  35. return (0, _timestamp.createDayList)(this.parsedStart, this.parsedEnd, this.times.today, this.weekdaySkips);
  36. },
  37. dayFormatter: function dayFormatter() {
  38. if (this.dayFormat) {
  39. return this.dayFormat;
  40. }
  41. var options = { timeZone: 'UTC', day: 'numeric' };
  42. return (0, _timestamp.createNativeLocaleFormatter)(this.locale, function (_tms, _short) {
  43. return options;
  44. });
  45. },
  46. weekdayFormatter: function weekdayFormatter() {
  47. if (this.weekdayFormat) {
  48. return this.weekdayFormat;
  49. }
  50. var longOptions = { timeZone: 'UTC', weekday: 'long' };
  51. var shortOptions = { timeZone: 'UTC', weekday: 'short' };
  52. return (0, _timestamp.createNativeLocaleFormatter)(this.locale, function (_tms, short) {
  53. return short ? shortOptions : longOptions;
  54. });
  55. }
  56. },
  57. methods: {
  58. getRelativeClasses: function getRelativeClasses(timestamp) {
  59. var outside = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  60. return {
  61. 'v-present': timestamp.present,
  62. 'v-past': timestamp.past,
  63. 'v-future': timestamp.future,
  64. 'v-outside': outside
  65. };
  66. },
  67. getStartOfWeek: function getStartOfWeek(timestamp) {
  68. return (0, _timestamp.getStartOfWeek)(timestamp, this.weekdays, this.times.today);
  69. },
  70. getEndOfWeek: function getEndOfWeek(timestamp) {
  71. return (0, _timestamp.getEndOfWeek)(timestamp, this.weekdays, this.times.today);
  72. }
  73. }
  74. }); // Mixins
  75. //# sourceMappingURL=calendar-base.js.map