mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Script: to_date accepts "now" as an argument
indentation fix
This commit is contained in:
committed by
Brendan Hagan
parent
46ab8870d1
commit
d1bac74eb9
@@ -216,9 +216,16 @@ SCRIPT_FUNCTION(to_color) {
|
||||
|
||||
SCRIPT_FUNCTION(to_date) {
|
||||
try {
|
||||
SCRIPT_PARAM_C(wxDateTime, input);
|
||||
SCRIPT_RETURN(input);
|
||||
} catch (const ScriptError& e) {
|
||||
SCRIPT_PARAM_C(String, input);
|
||||
if (input == "now") {
|
||||
SCRIPT_RETURN(wxDateTime::Now());
|
||||
}
|
||||
else {
|
||||
SCRIPT_PARAM_C(wxDateTime, input);
|
||||
SCRIPT_RETURN(input);
|
||||
}
|
||||
}
|
||||
catch (const ScriptError& e) {
|
||||
return delay_error(e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user