Skip to content

Commit

Permalink
add unixtime_now
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMochizuki committed Mar 1, 2023
1 parent 1f24b56 commit a1b9889
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,11 @@ const PlanTabPanel = (props: PlanTabPanelProps) => {

const getVariableValue = (variableName: string) => {
let variableIndex = -1;
let outcome: GetVariable = {value: NaN, isSuccess: false, convType: ""};
if (cmdFileVariables.findIndex(index => index.variable === variableName) >= 0) {
let outcome: GetVariable = { value: NaN, isSuccess: false, convType: "" };
if (variableName.toLowerCase() == "unixtime_now") {
outcome.value = Math.floor(new Date().getTime() / 1000);
outcome.isSuccess = true;
} else if (cmdFileVariables.findIndex(index => index.variable === variableName) >= 0) {
variableIndex = cmdFileVariables.findIndex(index => index.variable === variableName);
outcome.value = cmdFileVariables[variableIndex].value;
outcome.isSuccess = true;
Expand Down

0 comments on commit a1b9889

Please sign in to comment.