Describe the bug
Because you can set a default timezone, the dayjs.tz() method should have the second parameter (timezone) as optional. It works fine in JS โ just missing the correct types for TS.
Expected behavior
dayjs.tz.setDefault("America/Phoenix");dayjs.tz('some valid date') <- that shouldn't throw a TypeScript errordayjs('some valid date').tz() <- that shouldn't throw a TypeScript error eitherPotential Solution
declare module 'dayjs' {
interface Dayjs {
tz(timezone?: string): Dayjs;
}
interface DayjsTimezone {
(date?: ConfigType, timezone?: string): Dayjs;
}
}
Information
True, would you like pulling request for this?
Looks like #1081 beat me to it ๐
Looks like #1081 beat me to it ๐
a-ha ๐ฌ
Hey, sorry for just barging in and not asking if i could work on it. I was already inspecting the project and just checked the issues for motivation to dig in the source code and found this.
Sorry again
@gpetrioli hey, no worries ๐ Thanks for the PR. @iamkun any word on when the next release for the library is going to be?
:tada: This issue has been resolved in version 1.9.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Most helpful comment
:tada: This issue has been resolved in version 1.9.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: