When receiving times from a JCC GPLAN backend, all times are in the evening because the comparisons are against Unix epoch. The intended comparison was probably against e.g. midday + unix_date.

The latter comparison would (I believe) result in a 1 h offset for afternoon/evening due to DST in summertime. Attached patch simply looks at the hour component of the time.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frankschaap’s picture

I wonder what the solution is to get this working in Almelo, because it appears to be working there.

And yes, we need to use some weird offsets to for Qmatic in Vught. Hearing about your case makes me wonder if these systems even use timezones... so far we have not even needed to adjust for DST o_0

Heine’s picture

In Almelo, I guess +unix_date was added to the comparison. Anything past 17:00 is marked as evening there however, which I believe is not expected and due to DST differences between January and June. Coming October Almelo will probably start showing the slot 17:00 - 18:00 as afternoon again.

Do you happen to have a dump of values received in webform_appointment_date_time_element_process() from a Qmatic backend? I would assume both client adapters would result in identical datetime formats.

Heine’s picture

Scratch that :)

Evening is derived from new DateTime('1970-01-01 17:00', $timezone);

So, evening means anything after 17:00. Is that correct? I would expect 18:00 as the cutoff.

frankschaap’s picture

Regular opening hours are 9-17. So yeah, for the municipality evening opening hours are > 17:00.

frankschaap’s picture

Sticking to the organisation's interpretation of time of day may in fact not be the most clear and productive way to service the customer. Should we reconsider?

Tess Bakker’s picture

@Heine,

elseif ($hour < 17) {

or

elseif ($hour < 18) {

edit: my mistake, didn't notice the new comments today

Tess Bakker’s picture

You can make a variable for morning, midday and evening with as default the official standaards.

Heine’s picture

Attached patch introduces variables.

Tess Bakker’s picture

Status: Needs review » Needs work

Nice, only the variables will be called every run inside "foreach ($dates as $date => $time_array)"

Heine’s picture

Status: Needs work » Needs review
FileSize
1.96 KB

Indeed.

Tess Bakker’s picture

Status: Needs review » Reviewed & tested by the community

Works perfect!

Tess Bakker’s picture

Component: Code » Appointments
Heine’s picture

Project: Drupal voor Gemeenten » DvG Appointments
Version: 7.x-1.x-dev »
Component: Appointments » Documentation

Moving to fork.

MrHaroldA’s picture

Version: » 7.x-1.x-dev
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs reroll because of the rebranding ...

ralphvdhoudt’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
1.76 KB

Better patch, now against dvg appointments

MrHaroldA’s picture

Status: Needs review » Reviewed & tested by the community

Back to RbtC since there were no changes, except for using renamed functions.

  • MrHaroldA committed b7ab889 on 7.x-1.x authored by ralphvdhoudt
    Issue #2507505 by Heine, ralphvdhoudt: Available timeslots are always in...
MrHaroldA’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.