search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Navigator not right

Asked by Thomas Dumont-Goyette
7 years ago.

Hi,

I just realized that the navigator is 1 day too soon. For example, today is Tuesday May 9 but in the navigator May 9 is on Monday. So every date are one day too soon.

Comment posted by Dan Letecky [DayPilot]
7 years ago.

Can you please post your config? It looks like it only happens with a specific configuration (the online demo at https://javascript.daypilot.org/demo/calendar/navigator.html works fine).

Comment posted by Thomas Dumont-Goyette
7 years ago.

Here's my code:

var nav = new DayPilot.Navigator("nav");
nav.showMonths = 1;
nav.selectMode = "day";
nav.onTimeRangeSelected = function(args) {
loadTimeline(args.start);
loadEvents(); //my function to load the event
};
nav.init();

Comment posted by Dan Letecky [DayPilot]
7 years ago.

Thanks - unfortunately, I'm not able to reproduce the bug using the latest version. What DayPilot version do you use?

Comment posted by Thomas Dumont-Goyette
7 years ago.

1729. Is there a more recent version?

Answer posted by Dan Letecky [DayPilot]
7 years ago.

Yes, the latest version is 8.3.2848:

https://javascript.daypilot.org/try/

Did you download it as part of a tutorial? It may need an update - could you please let me know the URL?

Comment posted by Thomas Dumont-Goyette
7 years ago.

I've download the version 2848 and still have the problem

Comment posted by Thomas Dumont-Goyette
7 years ago.

Yes I download this tutorial https://code.daypilot.org/27988/html5-calendar-with-day-week-month-views-javascript-php and modify it as I wanted. Do you want all my code in my page to check?

Comment posted by Dan Letecky [DayPilot]
7 years ago.

You may need to force a full reload of the browser - sometimes the old version gets cached.

Or do you see the problem in the online demo as well?
https://javascript.daypilot.org/demo/calendar/navigator.html

This demo page uses the following configuration:
    var nav = new DayPilot.Navigator("nav");
    nav.showMonths = 3;
    nav.skipMonths = 3;
    nav.selectMode = "week";
    nav.freeHandSelectionEnabled = true;
    nav.onTimeRangeSelected = function(args) {
        console.log(args);
        dp.startDate = args.start;
        dp.update();
    };
    nav.onBeforeCellRender = function(args) {
        if (args.cell.isCurrentMonth) {
            args.cell.cssClass = "current-month";
        }
    };
    nav.init();

Changing it to your config doesn't reproduce the bug for me.

Let me know if it didn't help.

Comment posted by Thomas Dumont-Goyette
7 years ago.

You're right, needed to empty cache, should have tough about it thanks.

Comment posted by Dan Letecky [DayPilot]
7 years ago.

Great, thanks for the update. Let me know if there is any problem.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.