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

TypeScript error when using Timezone plugin: timezone.d.ts(7,7): error TS2304: Cannot find name 'Dayjs' #989

Closed
micalevisk opened this issue Aug 7, 2020 · 3 comments · Fixed by #994
Labels
☢️Bug Something isn't working released

Comments

@micalevisk
Copy link

I got this error: timezone.d.ts(7,7): error TS2304: Cannot find name 'Dayjs' when I use dayjs.extend(timezone);

I think that DayjsTimezone interface should be declared inside the module declaration

interface DayjsTimezone {
(): Dayjs
guess(): string
}
declare module 'dayjs' {
interface Dayjs {
tz(): Dayjs
}
const tz: DayjsTimezone
}

or Dayjs import is missing here

import { PluginFunc } from 'dayjs'

@iamkun iamkun added the ☢️Bug Something isn't working label Aug 7, 2020
@iamkun
Copy link
Owner

iamkun commented Aug 7, 2020

Yes, it's definitely a bug.

@iamkun
Copy link
Owner

iamkun commented Aug 8, 2020

fixed thanks

iamkun added a commit that referenced this issue Aug 8, 2020
iamkun added a commit that referenced this issue Aug 8, 2020
iamkun pushed a commit that referenced this issue Aug 10, 2020
## [1.8.33](v1.8.32...v1.8.33) (2020-08-10)

### Bug Fixes

* Add PluralGetSet plugin for plural getters/setters ([#996](#996)) ([f76e3ce](f76e3ce))
* Add typescript type defs in esm build ([#985](#985)) ([50e3b3c](50e3b3c))
* Fix isoWeek Plugin cal bug in UTC mode ([#993](#993)) ([f2e5f32](f2e5f32))
* Fix Timezone plugin parsing js date, Day.js object, timestamp bug && update type file ([#994](#994)) ([22f3d49](22f3d49)), closes [#992](#992) [#989](#989)
* Fix Timezone plugin UTCOffset rounding bug ([#987](#987)) ([b07182b](b07182b)), closes [#986](#986)
* Fix UTC plugin bug while comparing an utc instance to a local one ([#995](#995)) ([747c0fb](747c0fb))
* Update pt-br locale weekStart 0 ([#984](#984)) ([0f881c1](0f881c1))
@iamkun
Copy link
Owner

iamkun commented Aug 10, 2020

🎉 This issue has been resolved in version 1.8.33 🎉

The release is available on:

Your semantic-release bot 📦🚀

andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.8.33](iamkun/dayjs@v1.8.32...v1.8.33) (2020-08-10)

### Bug Fixes

* Add PluralGetSet plugin for plural getters/setters ([#996](iamkun/dayjs#996)) ([f76e3ce](iamkun/dayjs@f76e3ce))
* Add typescript type defs in esm build ([#985](iamkun/dayjs#985)) ([50e3b3c](iamkun/dayjs@50e3b3c))
* Fix isoWeek Plugin cal bug in UTC mode ([#993](iamkun/dayjs#993)) ([f2e5f32](iamkun/dayjs@f2e5f32))
* Fix Timezone plugin parsing js date, Day.js object, timestamp bug && update type file ([#994](iamkun/dayjs#994)) ([22f3d49](iamkun/dayjs@22f3d49)), closes [#992](iamkun/dayjs#992) [#989](iamkun/dayjs#989)
* Fix Timezone plugin UTCOffset rounding bug ([#987](iamkun/dayjs#987)) ([b07182b](iamkun/dayjs@b07182b)), closes [#986](iamkun/dayjs#986)
* Fix UTC plugin bug while comparing an utc instance to a local one ([#995](iamkun/dayjs#995)) ([747c0fb](iamkun/dayjs@747c0fb))
* Update pt-br locale weekStart 0 ([#984](iamkun/dayjs#984)) ([0f881c1](iamkun/dayjs@0f881c1))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.8.33](iamkun/dayjs@v1.8.32...v1.8.33) (2020-08-10)

### Bug Fixes

* Add PluralGetSet plugin for plural getters/setters ([#996](iamkun/dayjs#996)) ([f76e3ce](iamkun/dayjs@f76e3ce))
* Add typescript type defs in esm build ([#985](iamkun/dayjs#985)) ([50e3b3c](iamkun/dayjs@50e3b3c))
* Fix isoWeek Plugin cal bug in UTC mode ([#993](iamkun/dayjs#993)) ([f2e5f32](iamkun/dayjs@f2e5f32))
* Fix Timezone plugin parsing js date, Day.js object, timestamp bug && update type file ([#994](iamkun/dayjs#994)) ([22f3d49](iamkun/dayjs@22f3d49)), closes [#992](iamkun/dayjs#992) [#989](iamkun/dayjs#989)
* Fix Timezone plugin UTCOffset rounding bug ([#987](iamkun/dayjs#987)) ([b07182b](iamkun/dayjs@b07182b)), closes [#986](iamkun/dayjs#986)
* Fix UTC plugin bug while comparing an utc instance to a local one ([#995](iamkun/dayjs#995)) ([747c0fb](iamkun/dayjs@747c0fb))
* Update pt-br locale weekStart 0 ([#984](iamkun/dayjs#984)) ([0f881c1](iamkun/dayjs@0f881c1))
allmoviestvshowslistsfilmography28 added a commit to allmoviestvshowslistsfilmography28/dayjs that referenced this issue Sep 12, 2024
## [1.8.33](iamkun/dayjs@v1.8.32...v1.8.33) (2020-08-10)

### Bug Fixes

* Add PluralGetSet plugin for plural getters/setters ([#996](iamkun/dayjs#996)) ([d2c8a00](iamkun/dayjs@d2c8a00))
* Add typescript type defs in esm build ([#985](iamkun/dayjs#985)) ([212e799](iamkun/dayjs@212e799))
* Fix isoWeek Plugin cal bug in UTC mode ([#993](iamkun/dayjs#993)) ([0679b8f](iamkun/dayjs@0679b8f))
* Fix Timezone plugin parsing js date, Day.js object, timestamp bug && update type file ([#994](iamkun/dayjs#994)) ([69a9377](iamkun/dayjs@69a9377)), closes [#992](iamkun/dayjs#992) [#989](iamkun/dayjs#989)
* Fix Timezone plugin UTCOffset rounding bug ([#987](iamkun/dayjs#987)) ([bb49a77](iamkun/dayjs@bb49a77)), closes [#986](iamkun/dayjs#986)
* Fix UTC plugin bug while comparing an utc instance to a local one ([#995](iamkun/dayjs#995)) ([1b34a7f](iamkun/dayjs@1b34a7f))
* Update pt-br locale weekStart 0 ([#984](iamkun/dayjs#984)) ([e26af6b](iamkun/dayjs@e26af6b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️Bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants