context.js 507 B

123456789101112131415161718192021
  1. import React from 'react'
  2. import { CHINESE_MODEL, _, noop } from './const'
  3. import { getDaysOfMonth, getWeekSort } from './helper'
  4. const model = CHINESE_MODEL
  5. const days = getDaysOfMonth(_, _, model)
  6. const weekTags = getWeekSort(model)
  7. export const initialData = {
  8. model: model,
  9. days: days,
  10. weekTags: weekTags,
  11. onChangeModel: noop,
  12. onSelectDay: noop,
  13. onPrevMonth: noop,
  14. onPrevYear: noop,
  15. onNextMonth: noop,
  16. onNextYear: noop,
  17. }
  18. export const DateContext = React.createContext(initialData)