index.js 627 B

1234567891011121314151617181920212223
  1. import baseComponent from '../helpers/baseComponent'
  2. import popupMixin from '../helpers/mixins/popupMixin'
  3. import { props } from '../date-picker-view/props'
  4. import { formatDate } from './utils'
  5. const platformProps = {
  6. labelPropName: 'label',
  7. format(values, props) {
  8. const o = {
  9. datetime: 'yyyy-MM-dd hh:mm',
  10. date: 'yyyy-MM-dd',
  11. year: 'yyyy',
  12. month: 'yyyy-MM',
  13. time: 'hh:mm',
  14. }
  15. return formatDate(values.date, o[props.mode])
  16. },
  17. }
  18. baseComponent({
  19. behaviors: [popupMixin('#wux-picker', platformProps)],
  20. properties: props,
  21. })