Skip to content

date logic changed#358

Open
chanabyte wants to merge 2 commits into
mainfrom
forms-history
Open

date logic changed#358
chanabyte wants to merge 2 commits into
mainfrom
forms-history

Conversation

@chanabyte

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates week/date handling across the API and admin UI by replacing custom UTC/week-boundary logic with dayjs (UTC + ISO week), while also expanding the admin form builder experience (history filtering UI, publish success + empty-form draft flows, and form deletion).

Changes:

  • Standardize week-bound computations (Mon–Sun, UTC) and date formatting using dayjs + isoWeek + utc in server endpoints and admin pages.
  • Improve admin builder UX: history toolbar + advanced filter drawer, keyword search, empty-form draft prompt, publish success modal, and delete action.
  • Regenerate/update package-lock.json metadata.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
server/api/form/index.ts Switch weekday formatting + weekly bounds to dayjs.utc().startOf/endOf('isoWeek').
server/api/admin/class-progress.get.ts Replace custom date/week parsing + YMD formatting with dayjs ISO-week logic for filtering and output.
app/composables/useAdmin.ts Update date formatting, add builder state for new filters/modals, and refactor publish flow + deletion support.
app/pages/admin/builder.vue Update builder UI to use new composable state, add modals and advanced filters drawer, and adjust week label logic.
app/pages/admin/raffle.vue Replace getLastMonday usage with dayjs ISO-week week-start display.
app/pages/admin/styles/builder.css Add styles for new modals, toolbar/drawer UI, and empty-form/publish-success presentation.
package-lock.json Lockfile metadata churn (peer flags and related fields).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +391 to +396
const createdFormResponse = await callFormApi<any>('POST', {}, {
action: 'createForm',
startDate: weekStart || dayjs.utc().startOf('isoWeek').format('YYYY-MM-DD'),
published,
title: formTitle.value,
})
Comment on lines 39 to +41
if (selectedDate) {
const { mondayDate, sundayDate } = getWeekBoundsDates(selectedDate)
const mondayDate = dayjs.utc(selectedDate).startOf('isoWeek').toDate()
const sundayDate = dayjs.utc(selectedDate).endOf('isoWeek').toDate()
Comment on lines +106 to +107
const mondayDate = dayjs.utc(selectedDate).startOf('isoWeek').toDate()
const sundayDate = dayjs.utc(selectedDate).endOf('isoWeek').toDate()
Comment on lines +172 to +173
const mondayDate = dayjs.utc(selectedDate).startOf('isoWeek').toDate()
const sundayDate = dayjs.utc(selectedDate).endOf('isoWeek').toDate()
Comment on lines +179 to +182
.empty-form-copy { margin: 0; color: #374151; font-weight: 500; line-height: 1.5; }

.empty-form-copy { margin: 0; color: #374151; font-weight: 500; line-height: 1.5; }

<div class="modal-box">
<div class="modal-header">
<div>
<h3 class="modal-title">You cannot publish because its empty.</h3>
Comment thread app/pages/admin/builder.vue Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@AidanLoran AidanLoran self-assigned this Jun 9, 2026
@AidanLoran AidanLoran self-requested a review June 9, 2026 02:13
@AidanLoran AidanLoran removed their assignment Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants