This topic is locked

Time-Picker and Time Display

7/28/2009 2:39:38 AM
PHPRunner General questions
S
Shankar author

Hi.

Can I have some advice please on how to display a (start) time. I do not need this field for calculation purposes.

My problem is that, for example, One PM shows as 13:00:00 and I only want 13:00. I originally had the mysql field set to "time" and I thought this was the problem. I changed it to VarChar but still the problem exists.

I am using the "view as time" in Phprunner, as I love the time-picker facility.

So, how do I drop the seconds?

Help!
Shankar

J
Jane 7/28/2009

Shankar,
this behaviour is by design.

You can remove seconds on the list/view pages only using custom format on the "View as" settings dialog on the Visual Editor tab.

S
Shankar author 7/28/2009

Shankar,

this behaviour is by design.

You can remove seconds on the list/view pages only using custom format on the "View as" settings dialog on the Visual Editor tab.


Thanks, but the problem is I cannot change the view as type if I want the time-picker. How do I keep the time picker and get rid of the seconds (unticking the seconds box does not work).
Shankar

J
Jane 7/29/2009

Hi,
unfortunately there is no easy way to remove seconds on the add/edit pages. You can remove it on the list/view pages only.

S
Shankar author 7/29/2009

You can remove it on the list/view pages only.


How?
I don't care if the database field is 13:00 or 13:00:00 - all I want is the output (ie. view/list page) to show as 13:00 BUT still being able to edit it using the time-picker.
Shankar

X
xliner 7/30/2009

PHP coded custom datetime formatting like:
date('j.n.Y,g:i')
should do the trick on the date/time picker to not show the seconds, say for exmaple, "30.7.2009, 12:35" is going to be displayed

J
Jane 7/30/2009

Hi,
just use custom format on the "View as" settings dialog on the Visual Editor tab.

Here is a sample:

date('g:i',strtotime($value));

S
Shankar author 7/30/2009

Hi,

just use custom format on the "View as" settings dialog on the Visual Editor tab.

Here is a sample:


Thank you Jane and Hajo.
Jane - I pasted your exact code into the view as custom and it did, indeed, view as HH:MM in my browser. However, there appears to be a problem - it won't allow editing of this field (I still have edit as time with the time-picker).

I went back into the Visual Editor, clicked on properties (the little icon shows as custom) and the view as is back to "time" - the custom code is still there but it seems that if you use edit as time with time picker, then you cannot set custom code properly (or at least, it screws up the edit when the pages are built and uploaded).
Shankar

J
Jane 7/31/2009

Shankar,
please zip your project file and database creation script and open a ticket at http://support.xlinesoft.com sending your files along with instructions on reproducing this error.