Skip Navigation

[Closed] Creating a staff roster timetable system

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 1 year, 9 months ago.

Author
Posts
#2693771

Hello,

I'm wanting to build a staff roster timetable system where in backend, the web admin can enter the staff's shift work times.

I created a custom post type called "Staff".
And I also created a few number and single line custom fields and that's all fine.

What I'm not sure how to do is creating a time duration field.
For example, a staff will have these work shifts:

Monday : 7am - 4pm
Tuesday : 12pm - 8pm
Wednesday: 9pm - 12am
Thursday: 12am - 7am
Friday: 7pm - 12am
Sat: Off
Sun: Off

I'm not quite sure how to add the start time and the end time. Is it just a matter of adding 2 'Date' fields? The first date field is the "start time" and the 2nd date field is the "end time"?

And the other thing I'm wanting to be able to do is, be able to display the staff's name or their profile links on a "Calendar" view where if you imagine on the front end, there will be a "Calendar" with the following views: Who's On (day view), Who's On (weekly view) showing the staff's names and when you click on the staff name it will take you to the staff's profile page. Is this possible?

Upon researching, I found this link which uses the calendar - "CalendarAnything by CodeMine" on CodeCanyon which I am intending to use. - https://toolset.com/forums/topic/a-calendar-that-displays-custom-post-type-posts/

I just want advise on how to add the shift's start time and the end time (time duration)?

Thanks very much.

(added later)
I hope no one can see the site link associated with this ticket as the site is in development stage and I did not meant to be publicly viewable to the other users.
Not sure how to do it but if the site link associated with this ticket can be hidden or removed please. Thanks.

#2693931

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

First, please note that external links you share are automatically hidden from other users.

As far as advising you what to use for the start and end times, it somewhat depends on what the calendar plugin requires.

I looked at their documentation, but that just used the Event Calendar as an example, and it doesn't describe the range of possible formats that are acceptable for the date and time.

Types date fields are stored as timestamps (i.e. the number of seconds since 1 Jan 1970), which may be acceptable.

One thing I suspect you are going to run into is that whatever the format, the calendar is likely to be based on dates/times that are a moment in time, much like Types date fields.

I don't know if your intention is that the shifts will change from week to week, and where in your example you have "Monday: 7am - 4pm" what you really mean is "Monday 22 April 07:00 - Monday 22 April 16:00", which says nothing about next Monday or the Monday after.

It might help to discuss this with the calendar plugin author, and when you have determined what you need for the calendar to work we can advise you how to set up your custom fields.

The topic ‘[Closed] Creating a staff roster timetable system’ is closed to new replies.