You may create Custom script to handle it.
For First Question:
Just try to add function on form refresh event in Custom Script. For example.
frappe.ui.form.on(“Doctype Name”, “refresh”, function(doc){
// Write your logic here
});
For Second Question:
You may do same thing for it. Create Custom Script and then create function to handle your date and format.
Frappe already linked many functions with frappe.datetime object. You can use frappe.datetime.[function_name] according to your requirement.
For Example:
// this will return today date.
today = frappe.datetime.now_date();
For more detail visit this link:
Thanks