react-native-surveys
Version:
Build your own forms, surveys and polls for your React Native apps.
124 lines (123 loc) • 1.8 kB
JavaScript
export const DEFAULT_DATE_CONFIG = {
year: {
format: "YYYY",
caption: "Year",
step: 1
},
month: {
format: "M",
caption: "Month",
step: 1
},
date: {
format: "D",
caption: "Day",
step: 1
}
};
export const DATE_HOURS_CONFIG = {
year: {
format: "YYYY",
caption: "Year",
step: 1
},
month: {
format: "M",
caption: "Month",
step: 1
},
date: {
format: "D",
caption: "Day",
step: 1
},
hour: {
format: "hh",
caption: "Hour",
step: 1
},
minute: {
format: "mm",
caption: "Min",
step: 1
}
};
export const MONTHS_MAP = {
1: "Jan",
2: "Feb",
3: "Mar",
4: "Apr",
5: "May",
6: "Jun",
7: "Jul",
8: "Aug",
9: "Sept",
10: "Oct",
11: "Nov",
12: "Dec"
};
export const defaultProps = {
isPopup: true,
isOpen: false,
theme: "default",
value: new Date(),
min: new Date(1970, 0, 1),
max: new Date(2050, 0, 1),
showFooter: true,
showHeader: true,
showCaption: false,
dateConfig: {
year: {
format: "YYYY",
caption: "Year",
step: 1
},
month: {
format: "M",
caption: "Mon",
step: 1
},
date: {
format: "D",
caption: "Day",
step: 1
}
},
confirmText: "完成",
cancelText: "取消",
onChange: () => {},
onSelect: () => {},
onCancel: () => {}
};
export const dateConfigMap = {
year: {
format: "YYYY",
caption: "Year",
step: 1
},
month: {
format: "M",
caption: "Mon",
step: 1
},
date: {
format: "D",
caption: "Day",
step: 1
},
hour: {
format: "hh",
caption: "Hour",
step: 1
},
minute: {
format: "mm",
caption: "Min",
step: 1
},
second: {
format: "hh",
caption: "Sec",
step: 1
}
};