PromucFlow_constructor/app/client/src/widgets/DatePickerWidget.tsx

37 lines
952 B
TypeScript
Raw Normal View History

2019-09-12 08:11:25 +00:00
import React from "react";
import BaseWidget, { IWidgetProps, IWidgetState } from "./BaseWidget";
import { WidgetType } from "../constants/WidgetConstants";
2019-09-12 12:19:46 +00:00
import { ActionPayload } from '../constants/ActionConstants';
2019-09-12 08:11:25 +00:00
class DatePickerWidget extends BaseWidget<
DatePickerWidgetProps,
IWidgetState
> {
getPageView() {
return (
<div/>
);
}
getWidgetType(): WidgetType {
return "DATE_PICKER_WIDGET";
}
}
//Taken from https://blueprintjs.com/docs/#timezone/timezone-picker, needs to be completed with entire list
export type TimeZone = "Asia/Kolkata" | "Pacific/Midway"
export type DatePickerType = "DATE_PICKER" | "DATE_RANGE_PICKER"
export interface DatePickerWidgetProps extends IWidgetProps {
defaultDate?: Date
timezone?: TimeZone
enableTime: boolean
label: string
datePickerType: DatePickerType
2019-09-12 12:19:46 +00:00
onDateSelected: ActionPayload[]
onDateRangeSelected: ActionPayload[]
2019-09-12 08:11:25 +00:00
}
export default DatePickerWidget;