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

[Bug] Drag to create events with weekStartsOn Monday #1121

Closed
Mineyuki opened this issue Nov 7, 2019 · 3 comments
Closed

[Bug] Drag to create events with weekStartsOn Monday #1121

Mineyuki opened this issue Nov 7, 2019 · 3 comments

Comments

@Mineyuki
Copy link

Mineyuki commented Nov 7, 2019

Describe the bug

The feature to drag to create events didn't work well in the column Sunday when weekStartsOn Monday. It seems the calendar don't recognize the drag but recognize only the click.

Minimal reproduction of the problem with instructions

In the demo https://stackblitz.com/run?embed=1&file=demo/template.html (demo to drag) :

  • Add in DemoComponent : weekStartsOn: number = DAYS_OF_WEEK.MONDAY;
  • Import also DAYS_OF_WEEK : import { DayViewHourSegment, DAYS_OF_WEEK } from 'calendar-utils';
  • Add in template, the directive in mwl-calendar-week-view : [hourSegmentTemplate]="weekViewHourSegmentTemplate"
<mwl-calendar-week-view
  [viewDate]="viewDate"
  [events]="events"
  [hourSegmentTemplate]="weekViewHourSegmentTemplate"
>
</mwl-calendar-week-view>

Try to drag on Sunday and Monday. You will see the difference.

Screenshots

Versions

  • @angular/core: 8.2.2
  • angular-calendar: 0.27.20
  • Browser name and version: Chrome Version 78.0.3904.87
@matts-bot
Copy link

matts-bot bot commented Nov 7, 2019

Thanks so much for opening an issue! If you'd like me to give priority to answering your issue or would just like to support this project, then please consider sponsoring me

@Mineyuki Mineyuki changed the title Drag to create events with weekStartsOn Monday [Bug] Drag to create events with weekStartsOn Monday Nov 7, 2019
@mattlewis92
Copy link
Owner

Ah, I see the issue, you need to pass the week start variable to this line in your code: https://github.com/mattlewis92/angular-calendar/blob/master/projects/demos/app/demo-modules/drag-to-create-events/component.ts#L84 like this: const endOfView = endOfWeek(this.viewDate, {startOfWeek: this.startOfWeek});. I'll update the demo to make this more clear.

@Mineyuki
Copy link
Author

Mineyuki commented Nov 8, 2019

Hello,
It works ! Thank you very much !

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

No branches or pull requests

2 participants