Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(utc): add utc property to wrapper #22

Merged
merged 1 commit into from
Feb 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default (o, Dayjs, dayjs) => {
const wrapper = function (date, instance) {
return dayjs(date, {
locale: instance.$L,
utc: instance.$u,
calendar: instance.$C
})
}
Expand Down
12 changes: 12 additions & 0 deletions test/plugin.utc.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import jalali from '../src'

dayjs.extend(utc)
dayjs.extend(jalali)

it('Should respect utc', () => {
const date = dayjs.utc().calendar('jalali')

expect(date.isUTC()).toBe(true)
})