Clear repeater cell if date value in cell is greater than yesterday

newbie-question
repeater-widget

#1

I am trying to clear the contents in a repeater cell if the date in the cell is equal to or greater than today’s date, but show everything else where the date is less than todays date.

date_check.rp (58.8 KB)

For example in the attached file, If the current date was 12/07/2023 I would want to clear/hide the date in the date column in the first row but show everything for the remaining rows as the dates would be less than 12/07/2023.

Regards
Alan


#2

Hey Alan,

You can do this by using the Date.Parse() function. This function takes as a parameter the date string and returns the time difference as a number of milliseconds between January 1st 1970 and the date you use.

On the Item Loaded event of the repeater widget, set the variable value to [[Date.parse(Item.DateColumn)]]. Since the Item Loaded fires for every single row inside a repeater, you will get a one-dimensional data array with dates converted into numbers. Then, add a condition that compares the value of this variable with the [[Date.Parse(Now)]]. If it’s less than a current date, then use the “Set text” action to set the text on the date rectangle widget inside of the repeater to nothing. It should look like this:

date_check_AxureEdit.rp (60.4 KB)

I hope this helps! :slight_smile: If it doesn’t, please tell us a bit more about how the prototype should behave, and I will take a closer look!


#3

Thanks very much for your help this worked a treat.

Alan