add date picker operators to smart playlist

This commit is contained in:
jeffvli
2025-11-29 16:31:10 -08:00
parent 6094a520e2
commit a6945bc1f3
4 changed files with 186 additions and 8 deletions
@@ -192,6 +192,9 @@ export const NDSongQueryDateOperators = [
{ label: 'is in the last', value: 'inTheLast' },
{ label: 'is not in the last', value: 'notInTheLast' },
{ label: 'is in the range', value: 'inTheRange' },
{ label: 'is before (date)', value: 'beforeDate' },
{ label: 'is after (date)', value: 'afterDate' },
{ label: 'is in the range (date)', value: 'inTheRangeDate' },
];
export const NDSongQueryStringOperators = [
@@ -1,6 +1,12 @@
import type { DateInputProps as MantineDateInputProps } from '@mantine/dates';
import type {
DateInputProps as MantineDateInputProps,
DateTimePickerProps as MantineDateTimeInputProps,
} from '@mantine/dates';
import { DateInput as MantineDateInput } from '@mantine/dates';
import {
DateInput as MantineDateInput,
DateTimePicker as MantineDateTimeInput,
} from '@mantine/dates';
import styles from './date-picker.module.css';
@@ -33,3 +39,33 @@ export const DateInput = ({
/>
);
};
interface DateTimeInputProps extends MantineDateTimeInputProps {
maxWidth?: number | string;
width?: number | string;
}
export const DateTimeInput = ({
classNames,
maxWidth,
size = 'sm',
style,
width,
...props
}: DateTimeInputProps) => {
return (
<MantineDateTimeInput
classNames={{
input: styles.input,
label: styles.label,
required: styles.required,
root: styles.root,
section: styles.section,
...classNames,
}}
size={size}
style={{ maxWidth, width, ...style }}
{...props}
/>
);
};