Here's the script in a button you can add to a toolbar:
For reference, this is the script code inside the button:
function OnClick(clickData)
{
if (DOpus.GetClipFormat() != "text")
{
clickData.func.Dlg().Request("No text in clipboard.", "OK");
return;
}
var strDateDMY = DOpus.GetClip("text");
// DD-MM-YYYY -> YYYY-MM-DD
var strDateYMD = strDateDMY.replace(/.*(\d\d)-(\d\d)-(\d\d\d\d).*/,"$3-$2-$1");
if (strDateYMD == strDateDMY)
{
clickData.func.Dlg().Request("No DD-MM-YYYY date in clipboard.", "OK");
return;
}
var cmd = clickData.func.command;
// cmd.deselect = false; // Uncomment to prevent automatic deselection
cmd.RunCommand('SetAttr MODIFIED="' + strDateYMD + '"');
}