williamtroup / Calendar.js

📅 A javascript drag & drop event calendar, that is fully responsive and compatible with all modern browsers.
https://calendar-js.com
MIT License
478 stars 33 forks source link

initialDateTime not honored for views other than month #227

Open sebastianclaustrophobia opened 4 months ago

sebastianclaustrophobia commented 4 months ago

Description

The initialDateTime option is not honored when opening in full-day, full-week, or timeline. The full-year does display the requested year, but not at the month or day requested. This is true whether or not the viewToOpenOnFirstLoad is set.

To Reproduce Steps to reproduce the behavior:

  1. Enter an initialDateTime other than today in the calendar options.
  2. Open the calendar page.
  3. Click on full-day, full-week, or timeline view.

Expected behavior

I expect the calendar to open to the initialDateTime I entered into the options until the user navigates away from that date.

I expect the initialDateTime to show if the viewToOpenOnFirstLoad is set.

Screenshots

This is using the calendar.js.html test file.

01 initialDateTime and viewToOpenOnFirstLoad is set

02 result of above options

03 commenting out the viewToOpenOnFirstLoad

04 Month view does show initialDateTime

05 clicking on the week view shows the current week

Desktop (please complete the following information):

Smartphone (please complete the following information): not using a smartphone

Additional context

The calendar is a nice, lightweight option but unfortunately I'm working under certain constraints that make it vital to fix this. I have no problems with fixing it myself so I'll come back to it a little later.

williamtroup commented 4 months ago

This is not an issue but by design.

However, this is going to be updated and changed in a future version, which is currently in development.

I will keep you posted on the progress.

sebastianclaustrophobia commented 4 months ago

Thank you for the prompt response.