import * as PlainDateFns from 'temporal-polyfill/fns/PlainDate'
import * as ZonedDateTimeFns from 'temporal-polyfill/fns/ZonedDateTime'

export function warningFlow(zdt: Temporal.ZonedDateTime, date: Temporal.PlainDate) {
  const calendar = 'buddhist'
  const predicate = PlainDateFns.isRecord
  const methodName = 'addDays'

  return {
    calendar,
    dynamic: PlainDateFns[methodName](date, 1),
    formatter: new Intl.DateTimeFormat('en-US'),
    predicate,
    rounded: ZonedDateTimeFns.roundToHour(zdt, { smallestUnit: 'minute' }),
  };
}
