Like 2017-12-27
return Wednesday
1 Like
python - How do I get the day of week given a date? - Stack Overflow
edit: further pointers
How to get today date - #2 by BhupeshGupta
How to get today date - #24 by JoEz
from frappe.utils import get_weekday, getdate
day=get_weekday(getdate(“2023-11-28”))
output: ‘Tuesday’
where ever you want
frappe.ui.form.on('Employee Clearance Form', {
var a = new date(frm.doc.date):
var weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
frm.set_value("day",weekdays[a.getDay()])
});
frappe.ui.form.on('Employee Clearance Form', {
"date": function(frm) {
var a = new date(frm.doc.date):
var weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
frm.set_value("day",weekdays[a.getDay()])
}
});
frappe.ui.form.on('Employee Clearance Form', {
"date": function(frm) {
var a = new Date(frm.doc.date);
var weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
frm.set_value("day",weekdays[a.getDay()]);
}
});
1 Like