In my custom DocType I have a need where when a user selects Start Date the End Date should automatically get calculated. Here the rule is that End Date should always be 30 days after the Start Date.
Can I define such a rule at DocType level or have I to write custom script for this?
But in brower which is FireFox I am getting following Console dump
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: true, _useUTC: true, _l: undefined, _i: undefined, _f: undefined, _strict: undefined, _locale: [object Object]
t/<@http://localhost:8004/assets/js/libs.min.js?ver=1658757213.0:231:3368
va@http://localhost:8004/assets/js/libs.min.js?ver=1658757213.0:231:21539
Sa@http://localhost:8004/assets/js/libs.min.js?ver=1658757213.0:231:22250
c@http://localhost:8004/assets/js/libs.min.js?ver=1658757213.0:231:935
R@http://localhost:8004/assets/js/libs.min.js?ver=1658757213.0:234:3771
convert_to_user_tz@http://localhost:8004/assets/js/desk.min.js?ver=1658757213.0:17626:27
prettyDate@http://localhost:8004/assets/js/desk.min.js?ver=1658757213.0:12405:27
frappe.datetime.refresh_when/<@http://localhost:8004/assets/js/desk.min.js?ver=1658757213.0:12486:18
each@http://localhost:8004/assets/frappe/js/lib/jquery/jquery.min.js:2:2861
each@http://localhost:8004/assets/frappe/js/lib/jquery/jquery.min.js:2:845
frappe.datetime.refresh_when@http://localhost:8004/assets/js/desk.min.js?ver=1658757213.0:12485:27
@http://localhost:8004/assets/js/desk.min.js?ver=1658757213.0:12492:19
@YogiYang This error happens because the values of planned_start_date is a string and the first param required by add_days must be a date object so you must convert the date string to object by using frappe.datetime.str_to_obj or Date.parse.
While I see that the Due Date changes, for some reason it reverts back to the standard date immediately. I am at a loss as to why this is happening as there’s no error. Can you help identify the issue?