Set Date Format


Can any tell me how I  can change date in DD MMM YY format for every module.For example
date on sales order form display like 1 May 15.
For Example If we create new sales order then when we select delivery date then date is 
display like DD MMM YY format like 12 Apr 15.


I don’t think ERPNext supports DD MMM YY yet, but you can do that in your own print format.

thanks rmehta
but If I want to implement then what are the steps I have to to follow for set date format in erpnext.

Are you a developer? How familiar are you with frappe framework?

Yes I am developer and have idea about frappe,erpnext.
I have tried this issue for this I have follow following steps:

  1. Doctype List->System Settings->date format->dd mmm yy(option)->save
  2. Now when I create new sales order then date is display as format dd mmm yy but when i pick
    delivery date then correct date format is not selected.
1 Like

Second condition for helping is that you will send a pull-request. okay?

Yes, In second condition i am simply making a new sales order


can any one please suggest me how to convert date to dd-mm-yyyy from js side


{{ frappe.utils.formatdate(doc.get_formatted(‘your date fieldname’), “dd-MM-yyyy”) }}

thanks for reply
not for print format i want for report JS side
in the report this error is coming

Date 01-01-2019 must be in format: dd-mm-yyyy

Setup → System Settings → Date and Number format section
have you done this!!!

yeah there is in this format dd-mm-yyyy

can you show your code

i am using this code

if (temp_from_date == “” || temp_from_date == null) {
var temp_from_date = frappe.datetime.add_days(to_date, -(fetch_days_data));
//temp_from_date = (temp_from_date);
temp_from_date = moment(temp_from_date).format(“DD-MM-YYYY”);

{{frappe.utils.formatdate(doc.due_date, “dd-MM-yyyy”)}}
try this

1 Like

if i am using your code
var date = frappe.utils.formatdate(temp_from_date, “dd-MM-yyyy”);

its throwing this error
TypeError: frappe.utils.formatdate is not a function

var date = frappe.utils.formatdate(doc.temp_from_date, “dd-MM-yyyy”);

doc undefined error

can you send the full code of yours

function() {
var filters = report.get_values();
var from_date = filters.from_date;
var to_date = filters.to_date;
var temp_from_date = filters.temp_from_date;
var temp_to_date = filters.temp_to_date;

            var temp_from_date_filter = frappe.query_report.get_filter_value("temp_from_date");
	// console.log("Previous-primary-temp_from_date---------" + temp_from_date);
            var temp_to_date_filter = frappe.query_report.get_filter_value("temp_to_date");
            var fetch_days_data = frappe.query_report.get_filter_value("fetch_days_data");

            if (fetch_days_data != "" && fetch_days_data != null) {
                if (temp_from_date == "" || temp_from_date == null) {
                   var temp_from_date = frappe.datetime.add_days(to_date, -(fetch_days_data));
		//temp_from_date = (temp_from_date);
		temp_from_date = moment(temp_from_date).format("DD-MM-YYYY");
		var date = new Date();
		var date =,"dd-mm-yyyy");
		//frappe.query_report.set_filter_value("temp_from_date"," ");
		//var temp_from_date = from_date;
		//temp_from_date = moment(temp_from_date).format("DD-MM-YYYY")
		console.log("*******temp_to_dtemp_from_date----" + temp_from_date);
		//frappe.query_reports["INDIA-GSTR-2"].filters[5].options = temp_from_date;
		//frappe.query_reports["INDIA-GSTR-2"].filters[5].default = temp_from_date;

		//frappe.query_report.set_filter_value("temp_to_date"," ");
		var temp_to_date = to_date;
		temp_to_date = moment(temp_to_date).format("DD-MM-YYYY")
		console.log("*******temp_to_date----" + temp_to_date);
		//frappe.query_reports["INDIA-GSTR-2"].filters[6].options = temp_to_date;
		//frappe.query_reports["INDIA-GSTR-2"].filters[6].default = temp_to_date;
                    temp_from_date_filter.df.options = temp_from_date;
                    temp_from_date_filter.df.default = temp_from_date;
                    temp_to_date_filter.df.options = to_date;
                    temp_to_date_filter.df.default = to_date;
		  console.log("temp_from_date---------" + temp_from_date);
                    console.log("temp_to_date---------" + temp_to_date);