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

Calendar view one day added (end date) when an event is moved #20010

Merged
merged 3 commits into from
Oct 12, 2023
Merged

Conversation

br41nslug
Copy link
Member

@br41nslug br41nslug commented Oct 12, 2023

Fixes #19995

For rendering purposes we add an extra day to the endDate specifically for the Date type

const date = parse(item[endDateField.value], 'yyyy-MM-dd', new Date());
if (allDay && isValid(date)) {
// FullCalendar uses exclusive end moments, so we'll have to increment the end date by 1 to get the
// expected result in the calendar
date.setDate(date.getDate() + 1);
endDate = format(date, 'yyyy-MM-dd');

However this was not accounted for when updating the data resulting in each change in the calendar adding an extra day to the end.

Scope

What's changed:

  • Lorem ipsum dolor sit amet
  • Consectetur adipiscing elit
  • Sed do eiusmod tempor incididunt

Potential Risks / Drawbacks

  • Lorem ipsum dolor sit amet
  • Consectetur adipiscing elit

Review Notes / Questions

  • I would like to lorem ipsum

@changeset-bot
Copy link

changeset-bot bot commented Oct 12, 2023

🦋 Changeset detected

Latest commit: 1dd61a0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@directus/app Patch
@directus/api Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@paescuj paescuj left a comment

Choose a reason for hiding this comment

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

Nice 👌

@paescuj paescuj changed the title Fix 19995 Prevent extra day on calendar item move Oct 12, 2023
@br41nslug br41nslug changed the title Prevent extra day on calendar item move Calendar view one day added (end date) when an event is moved Oct 12, 2023
@paescuj paescuj merged commit b99eeb9 into main Oct 12, 2023
6 checks passed
@paescuj paescuj deleted the fix-19995 branch October 12, 2023 13:03
@github-actions github-actions bot added this to the Next Patch Release milestone Oct 12, 2023
@baudryj
Copy link

baudryj commented Oct 12, 2023

Thanks !

br-rafaelbarros pushed a commit to personal-forks/directus-source that referenced this pull request Nov 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calendar view one day added (end date) when an event is moved
3 participants