sort a list on the basis of shift timings w.r.t. current time

0
Hi, forum, I am trying to show a list of “demouser” (in a list view on the page) on the basis of working hours of “ demouser” I have multiple attributes in the entity in which two fields are ie “StartTime”(DateTime in HH mm format) and “FinishTime”(DateTime in HH mm format)  in the “ demouser” entity. The use case is such that a user will be listed if its user working hrs are between StartTime and FinishTime wrt current time. please suggest if this is possible in this way or something else is needed to be done.  
asked
1 answers
2

Omkar,

I think I understand your requirement.  You can use Xpath functions to accomplish this.  As a test, I created a Listview with the Xpath constraint below.  This shows all demousers for whom the Current Time is between their StartTime and FinishTime. 

[hours-from-dateTime(StartTime) <= hours-from-dateTime('[%CurrentDateTime%]')
and
minutes-from-dateTime(StartTime) <=  minutes-from-dateTime('[%CurrentDateTime%]')
and
hours-from-dateTime(FinishTime >= hours-from-dateTime('[%CurrentDateTime%]')
and
minutes-from-dateTime(FinishTime) >= minutes-from-dateTime('[%CurrentDateTime%]')]

I am not sure if this is exactly your use case, but if not, perhaps this example will give you a starting point.

Hope that helps,

Mike

answered