UNPKG

@prefecthq/prefect-ui-library

Version:

This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.

21 lines (17 loc) 694 B
import { DateRangeSelectPeriod, isDateRangeSelectPeriod } from '@prefecthq/prefect-design' import { RouteParam, InvalidRouteParamValue } from '@prefecthq/vue-compositions' import { LocationQueryValue } from 'vue-router' export class DateRangeSelectAroundPeriodParam extends RouteParam<DateRangeSelectPeriod> { protected override parse(value: LocationQueryValue): DateRangeSelectPeriod { if (isDateRangeSelectPeriod(value)) { return value } throw new InvalidRouteParamValue() } protected override format(value: DateRangeSelectPeriod): LocationQueryValue { if (isDateRangeSelectPeriod(value)) { return value } throw new InvalidRouteParamValue() } }