It would be useful to have an option to allow entry of dates and times, e.g. indicator.parameters.addDate(...), or possibly it is a flag that is applied to a string, e.g. indicator.parameters:setFlag("startDate", core.FLAG_DATE_TIME) or similar.
I'm currently using a string parameter and then some simple pattern matching. Like this...
- Code: Select all
if #instance.parameters.date > 0 then
local _, _, yyyy, mm, dd = string.find(instance.parameters.date, "(%d+)/(%d+)/(%d+)");
refDate = core.date(yyyy, mm, dd);
else
refDate = 0;
end
Which works fine. I use YYYY/MM/DD format here as it simple. Having to support localized date / time formats gets tricky, so having it built into the SDK would be really useful.
Many thanks.