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

Add the locale code to the Locale type #1580

Merged
merged 1 commit into from
Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions docs/Locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
* @typedef {Object} Locale
*
* @property {string} [code] - the locale code (ISO 639-1 + optional country code)
* @property {Function} [formatDistance] - the function that takes a token
* passed by `formatDistance` or `formatDistanceStrict` and payload,
* and returns localized distance in words.
Expand Down
1 change: 1 addition & 0 deletions src/add/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addBusinessDays/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addDays/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addHours/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addISOWeekYears/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addMilliseconds/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addMinutes/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addMonths/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addQuarters/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addSeconds/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addWeeks/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/addYears/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/areIntervalsOverlapping/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/closestIndexTo/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/closestTo/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/compareAsc/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/compareDesc/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInBusinessDays/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInCalendarDays/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInCalendarISOWeekYears/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInCalendarISOWeeks/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInCalendarMonths/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInCalendarQuarters/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInCalendarWeeks/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInCalendarYears/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInDays/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInHours/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInISOWeekYears/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInMilliseconds/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInMinutes/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInMonths/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInQuarters/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInSeconds/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInWeeks/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/differenceInYears/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/eachDayOfInterval/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/eachMonthOfInterval/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/eachWeekOfInterval/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/eachWeekendOfInterval/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/eachWeekendOfMonth/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/eachWeekendOfYear/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/eachYearOfInterval/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/endOfDay/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/endOfDecade/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/endOfHour/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/endOfISOWeek/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/endOfISOWeekYear/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/endOfMinute/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down
1 change: 1 addition & 0 deletions src/endOfMonth/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Interval = {
}

export type Locale = {
code?: string,
formatDistance?: (...args: Array<any>) => any,
formatRelative?: (...args: Array<any>) => any,
localize?: {
Expand Down