mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
eb5e83cdb4
* refactor: remove unused code * refactor: remove more unused code
19 lines
597 B
TypeScript
19 lines
597 B
TypeScript
import { IConstraint } from 'interfaces/strategy';
|
|
import { formatDateYMDHMS } from 'utils/formatDate';
|
|
import { 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;
|
|
};
|