I am creating a couple of date objects like such:
var labOrderTime = '20230811'
labOrderTime = DateUtil.convertDate('yyyyMMdd', 'yyyy-MM-dd', labOrderTime)
var start = '20230811125910'
start = DateUtil.convertDate('yyyyMMdd', 'yyyy-MM-dd', start)
I am then trying to compare the two to see if they are on the same day. I am running it to issues though trying to compare date objects that have a timestamp against those that do not.
Something like this:
if(labOrderTime == start ){
return 1
}
if(labOrderTime < start ){
return 2
}
if(labOrderTime > start ){
return 3
}
I am seeing it return 2 because it it treating my labOrderTime object as '2023-08-11 00:00:00'.
I have tried a bunch of different date functions but cannot seem to figure out how to get it to do exactly what I want here. Any assistance would be appreciated.