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 Definition: Make isSame accept quarter as unit with quarterOfYear imported #588

Merged
merged 4 commits into from
May 6, 2019
Merged
Changes from 3 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
10 changes: 8 additions & 2 deletions types/plugin/quarterOfYear.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { PluginFunc, QUnitType } from 'dayjs'
import { PluginFunc, ConfigType, QUnitType } from 'dayjs'

declare const plugin: PluginFunc
export = plugin

declare module 'dayjs' {
interface Dayjs {
quarter(): number

quarter(quarter: number): Dayjs

add(value: number, unit: QUnitType): Dayjs
Expand All @@ -16,5 +16,11 @@ declare module 'dayjs' {
startOf(unit: QUnitType): Dayjs

endOf(unit: QUnitType): Dayjs

isSame(date: ConfigType, unit?: QUnitType): Dayjs
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should return a boolean

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


isBefore(date: ConfigType, unit?: QUnitType): Dayjs

isAfter(date: ConfigType, unit?: QUnitType): Dayjs
}
}