Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: disable calendar #265

Merged
merged 3 commits into from
May 31, 2024
Merged

Feat: disable calendar #265

merged 3 commits into from
May 31, 2024

Conversation

rizfirman
Copy link
Collaborator

@rizfirman rizfirman commented May 30, 2024

Related

CMS Sribaduga - View Kalendar Reservasi

Changes

  • make date disable when date option < currentDate

Preview

Screenshot 2024-05-30 at 15 20 18

Evidence

title: make date disable when date option < currentDate
project: Jabar Super Apps
participants: @rizfirman @marsellavaleria19 @rayfajars @Ibwedagama

Comment on lines 480 to 485
formatDate(date, 'yyyy-MM-dd') <
formatDate(this.thisDay, 'yyyy-MM-dd') ||
(formatDate(date, 'yyyy-MM-dd') ===
formatDate(this.thisDay, 'yyyy-MM-dd') &&
getCurrentTime() > sessionStartTime)
)
Copy link

@Ibwedagama Ibwedagama May 31, 2024

Choose a reason for hiding this comment

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

minor:

hello @rizfirman I think this function can be simplified to improve readability wdyt? 🤔

 getDisabledDate(date, sessionStartTime) {
 
   const dateToCompare = formatDate(date, 'yyyy-MM-dd')
   const today = formatDate(this.thisDay, 'yyyy-MM-dd')
   const currentTime = getCurrentTime()

   const isBeforeToday = dateToCompare <  today
   const isAfterSessionStart= (dateToCompare === today) && (currentTime > sessionStartTime)
 
   return isBeforeToday || isAfterSessionStart
  }    

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hi, @Ibwedagama i already implementing it coz this solution is more easy to read. thanks!

@rizfirman rizfirman merged commit 74139a4 into development May 31, 2024
@rizfirman rizfirman deleted the feat/disable-calendar branch May 31, 2024 07:06
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.

4 participants