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