Skip to content

Commit

Permalink
rename createNativeYearMonthParseOps
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Mar 29, 2024
1 parent e62415a commit 38c3983
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/temporal-polyfill/src/funcApi/moveUtils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { createNativeConvertOps } from '../internal/calendarNativeQuery'
import {
createNativeDayOfYearOps,
createNativeDayOps,
createNativeDaysInMonthOps,
createNativeDaysInYearOps,
createNativeWeekOps,
createNativeYearMonthParseOps,
} from '../internal/calendarNativeQuery'
import * as errorMessages from '../internal/errorMessages'
import { IsoDateFields } from '../internal/isoFields'
Expand Down Expand Up @@ -96,7 +96,7 @@ export function moveToDayOfMonth<S extends DateSlots<string>>(
const normDayOfMonth = clampEntity('day', day, 1, daysInMonth, overflow)

return moveToDayOfMonthUnsafe(
createNativeYearMonthParseOps(calendar),
createNativeDayOps(calendar),
slots,
normDayOfMonth,
)
Expand Down
9 changes: 4 additions & 5 deletions packages/temporal-polyfill/src/funcApi/plainYearMonth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
import { refineCalendarId } from '../internal/calendarId'
import {
createNativeDateModOps,
createNativeDayOps,
createNativeYearMonthDiffOps,
createNativeYearMonthModOps,
createNativeYearMonthMoveOps,
createNativeYearMonthParseOps,
createNativeYearMonthRefineOps,
} from '../internal/calendarNativeQuery'
import { compareIsoDateFields, plainYearMonthsEqual } from '../internal/compare'
Expand Down Expand Up @@ -109,10 +109,9 @@ export function fromFields(
)
}

export const fromString = bindArgs(
parsePlainYearMonth,
createNativeYearMonthParseOps,
) as (s: string) => Record
export const fromString = bindArgs(parsePlainYearMonth, createNativeDayOps) as (
s: string,
) => Record

export function isInstance(record: any): record is Record {
return Boolean(record) && record.branding === PlainYearMonthBranding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ export const createNativeDiffOps = createNativeOpsCreator(
isoDiffOps,
intlDiffOps,
)
export const createNativeDayOps = createNativeOpsCreator(isoDayOps, intlDayOps)
export const createNativeYearMonthMoveOps = createNativeOpsCreator(
isoYearMonthMoveOps,
intlYearMonthMoveOps,
Expand Down Expand Up @@ -588,10 +589,6 @@ export const createNativeWeekOps = createNativeOpsCreator(
)

// String Parsing
export const createNativeYearMonthParseOps = createNativeOpsCreator(
isoDayOps,
intlDayOps,
)
export const createNativeMonthDayParseOps = createNativeOpsCreator(
isoMonthDayParseOps,
intlMonthDayParseOps,
Expand Down

0 comments on commit 38c3983

Please sign in to comment.