index.js 366 B

123456789101112131415
  1. export default (function (o, c) {
  2. var proto = c.prototype;
  3. proto.weekday = function (input) {
  4. var weekStart = this.$locale().weekStart || 0;
  5. var $W = this.$W;
  6. var weekday = ($W < weekStart ? $W + 7 : $W) - weekStart;
  7. if (this.$utils().u(input)) {
  8. return weekday;
  9. }
  10. return this.subtract(weekday, 'day').add(input, 'day');
  11. };
  12. });