Check Sunday Date

Hi,
I want to check the date if the date is sunday or not,
i tried by giving manual SUNDAY date for differentiate but its giving garbage value,

var check_sunday = frappe.datetime.get_day_diff( “20/05/2018” , frm.doc.period_start_date );
// I will do some logics here to check if it is sunday or not.

d = frappe.datetime.str_to_obj("20/05/2018");
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var dayName = days[d.getDay()];

@max_morais_dmm i’ll try and let you know the result

@max_morais_dmm many thanks buddy, its working.

1 Like