I have an Easy Chart that trends a ‘parts produced’ counter. I have given the user the ability to click somewhere in the chart (in Mark or X-Trace mode) then click a button that saves that timestamp to a text field component (startTimestamp). They then click a point on the chart further in time then click another button that saves that timestamp to another text field component (endTimestamp). I then use system.tag.queryTagHistory to extract a dataset of my counter in that time range, use a for loop to extract the min and max values and save max - min to a numeric text field component to show the user how many parts where produced in the selected range - all working very nicely.
I would now like to show parts produced per time in selected range. I think the best way to do this is to use system.date.*Between however if I do this using startTimestamp.text and endTimestamp.text I get an error:
TypeError: minutesBetween(): 1st arg can’t be coerced to java.util.Date
Is there an easy way to convert the .selectedXValue string to a system.date object?