fix: future date access on timetables for moderators
This commit is contained in:
@@ -638,7 +638,8 @@
|
||||
frappe.boot.single_types = []
|
||||
let courses = {{ course_list | json }};
|
||||
const legends = {{ legends | json }};
|
||||
const allow_future = {{ batch_info.allow_future }}
|
||||
const allow_future = {{ batch_info.allow_future }};
|
||||
const is_student = "{{ is_student or '' }}";
|
||||
const evaluation_end_date = "{{ batch_info.evaluation_end_date if batch_info.evaluation_end_date else '' }}"
|
||||
</script>
|
||||
|
||||
|
||||
@@ -765,13 +765,16 @@ const add_links_to_events = (calendar) => {
|
||||
calendar.on("clickEvent", ({ event }) => {
|
||||
let event_date = event.start.d.d;
|
||||
event_date = moment(event_date).format("YYYY-MM-DD");
|
||||
|
||||
let current_date = moment().format("YYYY-MM-DD");
|
||||
|
||||
if (!moment(event_date).isSameOrBefore(current_date) && !allow_future)
|
||||
if (
|
||||
is_student &&
|
||||
!moment(event_date).isSameOrBefore(current_date) &&
|
||||
!allow_future
|
||||
)
|
||||
return;
|
||||
|
||||
if (event.raw.milestone) {
|
||||
if (is_student && event.raw.milestone) {
|
||||
frappe.call({
|
||||
method: "lms.lms.doctype.lms_batch.lms_batch.is_milestone_complete",
|
||||
args: {
|
||||
|
||||
Reference in New Issue
Block a user