File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
pages/DashBoardPage/utils Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1616 * limitations under the License.
1717 */
1818
19- import { ControllerFacadeTypes } from 'app/constants' ;
19+ import { ControllerFacadeTypes , TimeFilterValueCategory } from 'app/constants' ;
2020import {
2121 ContainerItem ,
2222 WidgetType ,
2323} from 'app/pages/DashBoardPage/pages/Board/slice/types' ;
2424import { FilterSearchParamsWithMatch } from 'app/pages/MainPage/pages/VizPage/slice/types' ;
2525import { ChartsEventData } from 'app/types/Chart' ;
2626import ChartDataView from 'app/types/ChartDataView' ;
27- import { FilterSqlOperator } from 'globalConstants' ;
27+ import { formatTime } from 'app/utils/time' ;
28+ import { FilterSqlOperator , TIME_FORMATTER } from 'globalConstants' ;
2829import produce from 'immer' ;
2930import { DeltaStatic } from 'quill' ;
3031import { CSSProperties } from 'react' ;
@@ -816,6 +817,16 @@ export const getWidgetMap = (
816817 content . config . controllerDate . endTime . exactValue = _value ?. [ 0 ] ;
817818 }
818819 break ;
820+
821+ case ControllerFacadeTypes . Time :
822+ content . config . controllerDate = {
823+ ...( content . config . controllerDate as any ) ,
824+ startTime : {
825+ relativeOrExact : TimeFilterValueCategory . Exact ,
826+ exactValue : formatTime ( _value as any , TIME_FORMATTER ) ,
827+ } ,
828+ } ;
829+ break ;
819830 default :
820831 content . config . controllerValues = _value || [ ] ;
821832 break ;
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ export function getTime(
4848 } ;
4949}
5050
51- export function formatTime ( time : string | Moment , format ) : string {
52- return moment ( time ) . format ( format ) ;
51+ export function formatTime ( time : string | Moment , format ? ) : string {
52+ return moment ( time ) . format ( format || TIME_FORMATTER ) ;
5353}
5454
5555export function recommendTimeRangeConverter ( relativeTimeRange ) {
You can’t perform that action at this time.
0 commit comments