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
@Maheshwari_Bhavesh
Did you know how to do it?
please tell me
from frappe.utils import get_weekday, getdate
day=get_weekday(getdate(“2023-11-28”))
output: ‘Tuesday’
@bahaou
I want the date by default can I ?
And where I will put this code?
where ever you want
@Hardik_Gadesha check this please
why not become directly?
Share you code
@Nada-86 Code please
@Hardik_Gadesha for what Client Script or jinja ?
I didn’t write any code for date
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()])
}
});
@Nada-86 date field is present in your doctype ?
@Hardik_Gadesha yes
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
@Hardik_Gadesha
You Are Genius ![]()
I hope one day I become like you.



