fix(client): datetime with timezone
This commit is contained in:
parent
a9e1094f8b
commit
94a4d391c7
@ -1,5 +1,6 @@
|
|||||||
import { formatMomentValue, momentable } from '@formily/antd/lib/__builtins__';
|
import { formatMomentValue } from '@formily/antd/lib/__builtins__';
|
||||||
import type { DatePickerProps } from 'antd/lib/date-picker';
|
import type { DatePickerProps } from 'antd/lib/date-picker';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
export const getDefaultFormat = (props: DatePickerProps & { dateFormat: string; timeFormat: string }) => {
|
export const getDefaultFormat = (props: DatePickerProps & { dateFormat: string; timeFormat: string }) => {
|
||||||
if (props.format) {
|
if (props.format) {
|
||||||
@ -30,8 +31,8 @@ export const mapDateFormat = function () {
|
|||||||
return {
|
return {
|
||||||
...props,
|
...props,
|
||||||
format: format,
|
format: format,
|
||||||
|
value: props.value && moment(props.value).isValid() ? moment(props.value) : undefined,
|
||||||
value: momentable(props.value, format === 'YYYY-wo' ? 'YYYY-w' : format),
|
// value: momentable(props.value, format === 'YYYY-wo' ? 'YYYY-w' : format),
|
||||||
onChange: (value: moment.Moment | moment.Moment[]) => {
|
onChange: (value: moment.Moment | moment.Moment[]) => {
|
||||||
if (onChange) {
|
if (onChange) {
|
||||||
onChange(formatMomentValue(value, format));
|
onChange(formatMomentValue(value, format));
|
||||||
|
Loading…
Reference in New Issue
Block a user