mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
53354224fc
Upgrades biome to 1.6.1, and updates husky pre-commit hook. Most changes here are making type imports explicit.
19 lines
608 B
TypeScript
19 lines
608 B
TypeScript
import type { IConstraint } from 'interfaces/strategy';
|
|
import { formatDateYMDHMS } from 'utils/formatDate';
|
|
import type { ILocationSettings } from 'hooks/useLocationSettings';
|
|
import { CURRENT_TIME_CONTEXT_FIELD } from 'utils/operatorsForContext';
|
|
|
|
export const formatConstraintValue = (
|
|
constraint: IConstraint,
|
|
locationSettings: ILocationSettings,
|
|
): string | undefined => {
|
|
if (
|
|
constraint.value &&
|
|
constraint.contextName === CURRENT_TIME_CONTEXT_FIELD
|
|
) {
|
|
return formatDateYMDHMS(constraint.value, locationSettings.locale);
|
|
}
|
|
|
|
return constraint.value;
|
|
};
|