0

Get the hours from an appointment as an Array

Hello again. Sorry for all the questions all.

I am trying something, that I'm sure MUST work, I am just not sure how to do it.

Is there a way to stip the individual hours out of an appointment? What I mean is, let's say we have an appointment from 10:00 to 14:00. I am looking to get back the result of 10, 11, 12, 13, 14.

What I am trying to do is use this data to populate another table which is just Name, Date and then 24 1 hour blocks. If the block is marked "No" then the person is NOT doing anything. If "Yes" then the person is busy and can't be utilised for other tasks.

I have tried the Time, Hour, Date functions but am not getting the desired results. 

Any ideas please?

 

Thakns

 

John

3 replies

null
    • Fred
    • 5 mths ago
    • Reported - view

    Interestingly, you can't get time data very easily in Ninox. You can get the start()/end()/duration() of an appointment field.

    Even with time fields, there is no command like month or day that will get the hour or minutes of a time field.

    I can see the desire for a visual representation of availability, but it seems like a lot of work that we can get to the same data in some other way.

    It all depends on your how your dashboard is designed. So let's say you are assigning workers to an event (could be skipper or engineer or steward or anyone needed). So you select the event. The event already has day(s) assigned to it. In your dynamic choice field for Skipper (since there is only 1) you can only show skippers that aren't working that day. For positions with more than 1 worker you could use a dynamic multi choice field. Then you have a button that assigns the workers to the Event subtable Scheduled Workers.

    • Alain_Fontaine
    • 5 mths ago
    • Reported - view
    let ast := start(Appointment);
    let aen := endof(Appointment);
    if day(ast) = day(aen) then
        range(number(format(ast, "H")), number(format(aen, "H")) + number(format(aen, "m") != "0"))
    end
    
    • John_Wilmans
    • 5 mths ago
    • Reported - view

    Thanks for the help guys

Content aside

  • Status Answered
  • 5 mths agoLast active
  • 3Replies
  • 57Views
  • 3 Following