Date field - first time date enter enhacement

More
11 years 3 months ago - 11 years 3 months ago #32280 by gruz
When entering a new date these settings are ignored:
[img



This means when I select a date in Calendar, it always gives format like 2012-12-31. So even if I want to have time, I must enter it manually. Not critical, but not a pleasure.

Here is my suggestion to enhance it:
plugins/flexicontent_fields/date/date.php

Line 244
Code:
$calendar = JHTML::_('calendar', $date, $fieldname, $elementid.'_'.$n, '%Y-%m-%d', 'class="'.$required.'"');

replace with
Code:
switch ($date_allowtime) { case '1': $date_format = '%Y-%m-%d %H:%M'; break; case '2': $date_format = '%Y-%m-%d 00:00'; break; case '0': default : $date_format = '%Y-%m-%d'; break; } $calendar = JHTML::_('calendar', $date, $fieldname, $elementid.'_'.$n, $date_format, 'class="'.$required.'"');

So the Calendar JS will automatically insetr time if it's enabled.

Thanks.

J2.5
FC - 2.0 - Rev 1612 (since 17-00 30.12.2012)
Last edit: 11 years 3 months ago by gruz.

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #32284 by ggppdk
Thanks for bug report and fix !!! ;)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #32286 by igcorreia
this is cool. Great feature!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.383 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline