hsrai
December 6, 2023, 3:27pm
1
An event with start and end datetime fileds, is shown as “all-day” activity on calendar view, while I have not checked [All Day] while creating the said view. Using Frappe / ErpNext 14 version.
Is it with all, or am I missing something?
–
H. S.Rai
hsrai
December 14, 2023, 11:57pm
2
If this is the same beahaviou, then a few of you (about) are requested to confirm it, to make me sure that I am not missing something. In that case it is also requested to express your view about acceptance of this behaviour.
Otherwise some pointer may be given to get the desired behaviour.
hsrai
December 16, 2023, 12:56pm
3
Got a response on telegram group:
It shows all day for everyone
This is strange.
Then how you all are using it?
Or is it so that this feature is not used by many?
At:
https://docs.erpnext.com/docs/user/manual/en/calendar
Day view is not shown, only monthly views are shown.
avc
December 17, 2023, 7:23pm
4
Hi @hsrai :
Yes, this is a bug. Calendar views from doctype .js files are working well. This issue is only related to Calendar Views created from UI.
PR already raised to (try to) fix it.
frappe:develop
← git-avc:fix-calendar-view
opened 07:12PM - 17 Dec 23 UTC
Calendar views created from "Calendar View" doctype, uses 0 or 1 values instead … expected field mapping.
So `allDay` property gets `undefined` and calendar shows wrong data.
Solves https://github.com/frappe/frappe/issues/23830
Hope this helps.
hsrai
December 20, 2023, 2:52pm
5
I believe you changed following files:
apps/frappe/frappe/public/js/frappe/views/calendar/calendar.js
apps/frappe/frappe/commands/site.py
I replaced these two files. Restared bench (do it need to re-build), but found that my issue is not resolved.
avc
December 20, 2023, 3:01pm
6
Hi @hsrai :
Just this one:
apps/frappe/frappe/public/js/frappe/views/calendar/calendar.js
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
// MIT License. See license.txt
frappe.provide("frappe.views.calendar");
frappe.provide("frappe.views.calendars");
frappe.views.CalendarView = class CalendarView extends frappe.views.ListView {
static load_last_view() {
const route = frappe.get_route();
if (route.length === 3) {
const doctype = route[1];
const user_settings = frappe.get_user_settings(doctype)["Calendar"] || {};
route.push(user_settings.last_calendar || "default");
frappe.set_route(route);
return true;
} else {
return false;
}
}
This file has been truncated. show original
Added this conditional:
It’s working for me.
hsrai
December 20, 2023, 4:14pm
7
I am seeing:
committed 06:37AM - 17 Dec 23 UTC
and
frappe:develop
← git-avc:fix-calendar-view
opened 07:12PM - 17 Dec 23 UTC
Calendar views created from "Calendar View" doctype, uses 0 or 1 values instead … expected field mapping.
So `allDay` property gets `undefined` and calendar shows wrong data.
Solves https://github.com/frappe/frappe/issues/23830
The bug at: Calendar view created via UI ignores allDay property · Issue #23830 · frappe/frappe · GitHub does not address my issue, as I see.
My event was not “All day”. It was like 2 hour event, which is being shown as “All day”.
avc
December 20, 2023, 4:58pm
8
Hi @hsrai :
See this, it works well in my environment. This is for calendar view created with “Calendar view” doctype, but it’s working too for other calendars generated with .js file
With non-“All Day” configured.
With All Day.
If you are on development environment, try to restart your bench, clear-cache, etc …
1 Like
hsrai
December 21, 2023, 1:11pm
9
I did:
bench build
bench clear-cache
bench restart
and now it is working.
Thank you.