Trend Client unable to change start and end times and freeze at the same time

Hello,

Just wondering if anyone can help with my dilemma. Basically I have a TrendClient graphic in a screen graphic, which has this script to set custom start and end times (which use the date time pickers) and with just the first line in it, it works as intended and changes the charts time scale to whichever is picked in the left pane of the graphic. However I need it to also freeze the time, as it is incrementing the time by 1 second as soon as the time scale changes, so I put the chart.freeze = true line into the script, but now it doesn't change the time scale at all, it only freezes the chart with the current time and date and time duration (1 hour). Not sure if theres a work around, for this, or if anyone has any idea what to change.

 

this is the graphic I have and what the left looks like for context.