-
Notifications
You must be signed in to change notification settings - Fork 52
Add lending calendar #5586
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
base: master
Are you sure you want to change the base?
Add lending calendar #5586
Conversation
674950c
to
90cce6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2025-05-22 14:26:13 CET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
<Card> | ||
<Flex column gap="var(--spacing-md)"> | ||
<h3>Ny forespørsel</h3> | ||
<LendingRequestEditor onRangeChange={setRange} /> | ||
</Flex> | ||
</Card> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this in a card?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks better when the new request form is inside it's own container, separate from the calendar
onChange={(value: [Dateish, Dateish]) => { | ||
if (onRangeChange && value && value.length === 2) { | ||
onRangeChange(value); | ||
} | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this? Should this logic not be added to the date picker itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the plan is to use the calendar as the actual date picker in the next iteration if that's what you mean
lendableObjectId, | ||
selectedRange, | ||
}: LendingCalendarProps) => { | ||
const [currentMonth, setCurrentMonth] = useState(moment()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it says current month but it stores the current day? not sure if intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stored day is only used to track which month (and year) the calendar should display, that's why I called it month and not day. Can change it though
|
||
.dayCell { | ||
vertical-align: top; | ||
padding: 0 !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
Description
Adds a calendar to show unavailable time slots given a lendable object, as well the time slots chosen for the current lending request. The calendar is added to both the new lending request and lending request detail pages.
Next step will be to make the calendar function as the date and time picker for new lending requests.
Backend PR
Result
Screencast.From.2025-05-20.00-06-10.online-video-cutter.com.mp4
Testing
Create and approve a lending request. Verify that the calendar displays unavailable and selected time slots correctly.
Resolves ABA-1438