/
githubmirror
/
dayjs
Обзор
Документация
Войти
/
githubmirror
/
dayjs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/plugin/weekday/index.js
12 строк
358 B
iamkun
fix: Add weekday (locale aware day of the week) plugin (#569)
15 апр 2019, 07:59
Не верифицирован
15 апр 2019, 07:59
9007cc5
Код
Авторство
О чём код?
export default (o, c) => { const proto = c.prototype proto.weekday = function (input) { const weekStart = this.$locale().weekStart || 0 const { $W } = this const weekday = ($W < weekStart ? $W + 7 : $W) - weekStart if (this.$utils().u(input)) { return weekday } return this.subtract(weekday, 'day').add(input, 'day') } }