Custom Field Date Render Incorrectly

1 view
Skip to first unread message

Phil -- wbtc.fr --

unread,
Oct 6, 2010, 4:42:27 AM10/6/10
to in-port...@googlegroups.com
Hello,

in forms.tpl we have inp_edit_date, to enter only Date, and we have in option definition an hidden input for Time.

When rendering the custom Date field on front, we have everytime tjhe date followed by "12:00 AM" (the hidden hour appears here). Where can I modify this rendering, and should it be something to correct?

Phil.

Alexander Obuhovich

unread,
Oct 6, 2010, 4:46:46 AM10/6/10
to in-port...@googlegroups.com
12:00:00 AM (12h format) is same as 00:00:00 (24 h format). Since you are not entering time, then it's 0 by default. And because of you only display date, then you won't see that "12:00 AM" anywhere on the site too.

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.



--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Phil -- wbtc.fr --

unread,
Oct 6, 2010, 5:09:00 AM10/6/10
to in-port...@googlegroups.com
- my custom field is named "date" and exist in admin

- I ask for date in suggest article form using  <inp2:m_RenderElement name="inp_edit_date" prefix="n" field="cust_date" title="lu_date_evenement"/> 

- I display the custom field using  <inp2:n_Field name="cust_date"/> 

and it displays date + time

Where am I wrong?

2010/10/6 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Oct 6, 2010, 5:28:25 AM10/6/10
to in-port...@googlegroups.com
That's a bug actually. Since "Date" custom field type was invented it was never used by anyone.

Task: http://tracker.in-portal.org/view.php?id=881
date_custom_field_shows_time_too.patch

Phil -- wbtc.fr --

unread,
Oct 6, 2010, 6:01:53 AM10/6/10
to in-port...@googlegroups.com
what if we remove the hidden "time" input from form?

2010/10/6 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Oct 6, 2010, 6:05:23 AM10/6/10
to in-port...@googlegroups.com
I doubt, that it will help, but you can try.

More elegant solution, in case if you won't be applying that patch, is to replace <inp2:n_Field name="cust_date"/> tag with <inp2:n_Field name="cust_date" format="_regional_DateFormat"/> tag.

Such "format" parameter allows to override whatever format was defined in unit config file.

Phil -- wbtc.fr --

unread,
Oct 6, 2010, 6:10:49 AM10/6/10
to in-port...@googlegroups.com
cool solution, thanks :)

2010/10/6 Alexander Obuhovich <aik....@gmail.com>
Reply all
Reply to author
Forward
0 new messages