mirror of
https://github.com/velocitatem/PHANTOM.git
synced 2026-07-16 01:53:37 +00:00
* fix: fixes of backwords * fixing hotel information with image placeholders * chore: clean up product display in hotel and cleaner interfacing * adding loader with historical data loading * feature: cleaning up pipeline * chore: simple surge pricer * created new pricing pipeline * adding a checkout page to both sites * fix: fixing stale pacakge * test: we wont be using elasticity anymore so its okay * chore: cleaning elasticity references * chore: store sting * feature: e2e intro pipline surge pricing * fix: CVE vulnerability patching
30 lines
806 B
TypeScript
30 lines
806 B
TypeScript
import { InputHTMLAttributes, useMemo } from 'react';
|
|
|
|
interface DateInpProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {}
|
|
|
|
export default function DateInput({ className = '', ...props }: DateInpProps) {
|
|
const { minDate, maxDate } = useMemo(() => {
|
|
const today = new Date();
|
|
const tomorrow = new Date(today);
|
|
tomorrow.setDate(today.getDate() + 1);
|
|
|
|
const tenDaysOut = new Date(tomorrow);
|
|
tenDaysOut.setDate(tomorrow.getDate() + 9); // tomorrow + 9 = 10 days total
|
|
|
|
return {
|
|
minDate: tomorrow.toISOString().split('T')[0],
|
|
maxDate: tenDaysOut.toISOString().split('T')[0]
|
|
};
|
|
}, []);
|
|
|
|
return (
|
|
<input
|
|
type="date"
|
|
className={`input-field ${className}`.trim()}
|
|
min={minDate}
|
|
max={maxDate}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|