refactor: account modals with auto-select and formatting
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -302,8 +302,8 @@
|
||||
function isDateUnavailable(date: DateValue): boolean {
|
||||
const d = date as CalendarDate;
|
||||
const jsDate = d.toDate(getLocalTimeZone());
|
||||
const now = new Date();
|
||||
const todayStart = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||
const now = new SvelteDate();
|
||||
const todayStart = new SvelteDate(now.getFullYear(), now.getMonth(), now.getDate());
|
||||
if (jsDate < todayStart) return true;
|
||||
if (d.compare(minDate) < 0 || d.compare(maxCalendarDate) > 0) return true;
|
||||
if (!workingHours) return true;
|
||||
@@ -378,7 +378,7 @@
|
||||
$effect(() => {
|
||||
if (editMode === 'services') {
|
||||
// Fetch hours for the booking's current date to calculate remaining time
|
||||
const bookingDate = new Date(booking.start_time);
|
||||
const bookingDate = new SvelteDate(booking.start_time);
|
||||
const calDate = new CalendarDate(
|
||||
bookingDate.getFullYear(),
|
||||
bookingDate.getMonth() + 1,
|
||||
@@ -581,7 +581,7 @@
|
||||
function calculateRemainingTime(): number {
|
||||
if (!workingHours || !availableHours) return 0;
|
||||
|
||||
const bookingDate = new Date(booking.start_time);
|
||||
const bookingDate = new SvelteDate(booking.start_time);
|
||||
const dateStr = `${bookingDate.getFullYear()}-${String(bookingDate.getMonth() + 1).padStart(2, '0')}-${String(bookingDate.getDate()).padStart(2, '0')}`;
|
||||
|
||||
const dayWH = workingHours[dateStr];
|
||||
|
||||
Reference in New Issue
Block a user