Skip to content

Commit

Permalink
fix(time): throws error in nuxt caused by getTimezoneOffset, closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni committed Mar 15, 2022
1 parent 0a8760c commit 462ff44
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- Fix `useDialog` renders component with popup content with unexpected focus management behavior, closes [#2612](https://github.com/TuSimple/naive-ui/issues/2612).
- Fix `n-tree-select`'s node sometimes can't be clicked when `check-strategy` is `'child'`.
- Fix `n-tree-select`'s emitted value can be not corresponding to `check-strategy` when delete option in select box with `check-strategy` is not `'all'`.
- Fix `n-time` throws error in nuxt caused by `getTimezoneOffset`, closes [#2545](https://github.com/TuSimple/naive-ui/issues/2545).

### Feats

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- 修复 `useDialog` 中使用带有弹出层的元素有异常的焦点管理行为,关闭 [#2612](https://github.com/TuSimple/naive-ui/issues/2612)
- 修复 `n-tree-select``check-strategy``'child'` 时有的节点不能被点击
- 修复 `n-tree-select``check-strategy` 不为 `'all'` 的时候从选框中删除时发出的值可能和 `check-strategy` 不对应
- 修复 `n-time` 在 nuxt 中由于 `getTimezoneOffset` 报错的问题,关闭 [#2545](https://github.com/TuSimple/naive-ui/issues/2545)

### Feats

Expand Down
2 changes: 1 addition & 1 deletion src/time/src/Time.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { h, createTextVNode, PropType, defineComponent, computed } from 'vue'
import { format, formatDistance, fromUnixTime, getTime } from 'date-fns'
import { getTimezoneOffset } from 'date-fns-tz'
import getTimezoneOffset from 'date-fns-tz/esm/getTimezoneOffset'
import { useLocale } from '../../_mixins'
import { ExtractPublicPropTypes } from '../../_utils'

Expand Down

0 comments on commit 462ff44

Please sign in to comment.