Skip to content

Commit

Permalink
Fix examples in differenceInDays and differenceInCalendarDays (#1124)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaddeusJiang authored and kossnocorp committed Jun 3, 2019
1 parent 4d6ed87 commit 1d5af4d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/differenceInCalendarDays/index.js
Expand Up @@ -32,7 +32,7 @@ var MILLISECONDS_IN_DAY = 86400000
* // How many calendar days are between
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
* var result = differenceInCalendarDays(
* new Date(2011, 6, 2, 0, 1),
* new Date(2011, 6, 3, 0, 1),
* new Date(2011, 6, 2, 23, 59)
* )
* //=> 1
Expand Down
2 changes: 1 addition & 1 deletion src/differenceInDays/index.js
Expand Up @@ -30,7 +30,7 @@ import compareAsc from '../compareAsc/index.js'
* // How many days are between
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
* var result = differenceInDays(
* new Date(2011, 6, 2, 0, 1),
* new Date(2011, 6, 3, 0, 1),
* new Date(2011, 6, 2, 23, 59)
* )
* //=> 0
Expand Down
3 changes: 2 additions & 1 deletion src/format/index.js.flow
Expand Up @@ -42,6 +42,7 @@ declare module.exports: (
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
firstWeekContainsDate?: number,
locale?: Locale,
awareOfUnicodeTokens?: boolean
useAdditionalWeekYearTokens?: boolean,
useAdditionalDayOfYearTokens?: boolean
}
) => string
6 changes: 4 additions & 2 deletions src/index.js.flow
Expand Up @@ -224,7 +224,8 @@ declare module.exports: {
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
firstWeekContainsDate?: number,
locale?: Locale,
awareOfUnicodeTokens?: boolean
useAdditionalWeekYearTokens?: boolean,
useAdditionalDayOfYearTokens?: boolean
}
) => string,

Expand Down Expand Up @@ -437,7 +438,8 @@ declare module.exports: {
locale?: Locale,
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
awareOfUnicodeTokens?: boolean
useAdditionalWeekYearTokens?: boolean,
useAdditionalDayOfYearTokens?: boolean
}
) => Date,

Expand Down
3 changes: 2 additions & 1 deletion src/parse/index.js.flow
Expand Up @@ -43,6 +43,7 @@ declare module.exports: (
locale?: Locale,
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
awareOfUnicodeTokens?: boolean
useAdditionalWeekYearTokens?: boolean,
useAdditionalDayOfYearTokens?: boolean
}
) => Date
18 changes: 12 additions & 6 deletions typings.d.ts
Expand Up @@ -408,7 +408,8 @@ declare module 'date-fns' {
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6
firstWeekContainsDate?: number
locale?: Locale
awareOfUnicodeTokens?: boolean
useAdditionalWeekYearTokens?: boolean
useAdditionalDayOfYearTokens?: boolean
}
): string
namespace format {
Expand Down Expand Up @@ -840,7 +841,8 @@ declare module 'date-fns' {
locale?: Locale
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6
firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7
awareOfUnicodeTokens?: boolean
useAdditionalWeekYearTokens?: boolean
useAdditionalDayOfYearTokens?: boolean
}
): Date
namespace parse {
Expand Down Expand Up @@ -7409,7 +7411,8 @@ declare module 'date-fns/esm' {
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6
firstWeekContainsDate?: number
locale?: Locale
awareOfUnicodeTokens?: boolean
useAdditionalWeekYearTokens?: boolean
useAdditionalDayOfYearTokens?: boolean
}
): string
namespace format {
Expand Down Expand Up @@ -7841,7 +7844,8 @@ declare module 'date-fns/esm' {
locale?: Locale
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6
firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7
awareOfUnicodeTokens?: boolean
useAdditionalWeekYearTokens?: boolean
useAdditionalDayOfYearTokens?: boolean
}
): Date
namespace parse {
Expand Down Expand Up @@ -16367,7 +16371,8 @@ interface dateFns {
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6
firstWeekContainsDate?: number
locale?: Locale
awareOfUnicodeTokens?: boolean
useAdditionalWeekYearTokens?: boolean
useAdditionalDayOfYearTokens?: boolean
}
): string

Expand Down Expand Up @@ -16577,7 +16582,8 @@ interface dateFns {
locale?: Locale
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6
firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7
awareOfUnicodeTokens?: boolean
useAdditionalWeekYearTokens?: boolean
useAdditionalDayOfYearTokens?: boolean
}
): Date

Expand Down

0 comments on commit 1d5af4d

Please sign in to comment.