Standard time format other than military?

645 views
Skip to first unread message

Jason Ballantyne

unread,
Oct 14, 2014, 4:47:50 PM10/14/14
to easy-app...@googlegroups.com
Any ideas on how to modify the time to 1:00 PM as opposed to 13:00? That would sure be nice, thanks.

Alex Tselegidis

unread,
Oct 19, 2014, 1:37:18 PM10/19/14
to easy-app...@googlegroups.com
Hello! You will have to make some modifications because version 1.0 does not support time formatting (this will be added in the next version).

Change line 367 of "/application/controllers/appointments.php" to

$available_hours[] = $current_hour->format('h:i A'); 

and comment line 395 of the same file

//sort($available_hours, SORT_STRING );

Then you will have to change the width of each time column through file "/assets/js/frontend_book.js", line 333

$('#available-hours').html('<div style="width:80px; float:left;"></div>');

and line 338

$('#available-hours').append('<div style="width:80px; float:left;"></div>');

and finally change line 466 of the same file to 

+ ' ' + Date.parse((($('.selected-hour').text()) ? $('.selected-hour').text() : '00:00')).toString('HH:mm') + ':00',


If you experience issues with this let me know in order to solve them.

Craig Tucker

unread,
Oct 19, 2014, 10:27:36 PM10/19/14
to easy-app...@googlegroups.com
Perfect, that works.  Date.parse was alluding me.  Now I understand.  Thank you.

Jason Ballantyne

unread,
Oct 23, 2014, 11:31:21 AM10/23/14
to easy-app...@googlegroups.com
Alex,

Wonderful work around - It works great.  Thank you so much, I appreciate your help.

Best Regards,

Jason

Craig Tucker

unread,
Oct 26, 2014, 2:52:56 AM10/26/14
to easy-app...@googlegroups.com
It registers but not completely.  I see that the calcEndDatetime function does not seem to work with the 12 hour format.  Only the start time posts to the calendar and the end time does not.

Craig Tucker

unread,
Oct 26, 2014, 11:59:21 AM10/26/14
to easy-app...@googlegroups.com
This is last part of the solution:


At line 503 replace:  + ' ' + $('.selected-hour').text();

with:

+ ' ' + Date.parse((($('.selected-hour').text()) ?$('.selected-hour').text() : '00:00')).toString('HH:mm'),

Adarsh Pradeep

unread,
Nov 21, 2014, 8:54:36 PM11/21/14
to easy-app...@googlegroups.com
Hi guys,

I modified the files Alex had mentioned and it works perfectly for the user in front-end when booking an appointment. What is the appropriate modifications in the .js files for the backend so the calendar too displays it in the same non military time format? I am looking in the backend_calendar.js file but don't want to screw things up. Thanks!

Tom Le

unread,
Nov 21, 2014, 10:01:26 PM11/21/14
to easy-app...@googlegroups.com
Hi,

I have another problem with this.  The first time of booking, the time slots show 08:00 AM , 08:10 AM, etc.... to 06:00 PM, which is sort correctly from 8:00AM to 6:00PM, but after booking the time, the next booking show the sort of the time interval is at 01:00PM, 01:10PM, etc.. to 11:50AM.

Anybody has this problem.  Please advise.

Thanks

Tom Le

unread,
Nov 21, 2014, 11:23:06 PM11/21/14
to easy-app...@googlegroups.com
Here is what I did

commented out the $availa.....
             // $available_hours = array_values($available_hours);
             // sort($available_hours, SORT_STRING );


and added the following ..

            $orderByTime = array();
             foreach($available_hours as $index => $value) {
                $orderByTime[$index]  = strtotime($value);
           }
            array_multisort($orderByTime, SORT_ASC, $available_hours);

Tristan Nguyen

unread,
Dec 1, 2014, 12:16:25 AM12/1/14
to easy-app...@googlegroups.com
Hi

i've completely modify this js to work on AU datetime here is my files.
let me know how you go.


frontend_book.js

Commerce Computer Repair

unread,
Apr 10, 2015, 11:35:41 PM4/10/15
to easy-app...@googlegroups.com
Hello,
If you want in the backend instead of hour format to have AM/PM to show here is the steps
1) Go to appointment/assets/js
2) go to line 33 and 34 in backend_calendar.js and put

'axisFormat': 'hh:mm t',
            'timeFormat': 'hh:mm t{ - hh:mm t}',

Dev Team

unread,
Jul 15, 2015, 9:55:39 AM7/15/15
to easy-app...@googlegroups.com
Hello,

One more change to keep Selected time active

at frontend_book.js, line no 353

replace line from
'yyyy-MM-dd HH:mm:ss').toString('HH:mm');

to

 'yyyy-MM-dd HH:mm:ss').toString('hh:mm tt');

Also At backend_calendar.js, there are lot of places where we have to change timeformat.


Reply all
Reply to author
Forward
0 new messages