Project:SQL Search (Trip Search)
Version:master
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:active

Issue Summary

if you select january 8, 2005 in the popup calendar, the user sees 08/01/2005 which looks like august 1 not jan 8 on my site. the popup has to know about site defaults in order for this to work right

Comments

#1

Priority:normal» minor

here is a calendarFormat variable in calendar.js and in an .html file. I did not try to fix this, but rather documented the right date format in the advabnced search form. changing priority to minor.

#2

The calendar ought to pick up the date format appropriate to the browser, and suggestions about how to do this are welcome. For the moment everything ought to be in dd/mm/yyyy format.

#3

The date thing is a bit confusing. When I create an Event, the format is YYYY-MM-DD HH:MM, when the date is displayed it's MM/DD/YYYY. When using trip/sql search it's DD/MM/YYYY, but the results are still displayed with MM/DD/YYYY. I personally would prefer the whole thing to be YYYY-MM-DD HH:MM, but I'm thinking in php/mysql terms. The users of my site (US) would probably prefer the whole thing to be in MM/DD/YYYY. It makes sense to me to have the date input the same as date output.

#4

What ought to happen is that trip_search picks up the date format from the browser, then uses that to set both the appropriate date format both for the popup date selector and the conversion of the date format that will be used in searching. That way the user will always see the right date format, from his point of view. The date output is set at the level of your site settings in Drupal, if I remember rightly.

The problem is that I have no idea how to do the most elementary thing which is to find out what is the user's date format on the browser! And as I said, if anyone can help with that I would be grateful. Otherwise, perhaps it would indeed be better to use YYYY-MM-DD since at least this is equally confusing for everybody rather than it being as it is now, ie normal behaviour for Europeans and confusing for Americans.

#5

Hi all,

Dunno if this is any help, but setting up JSCalendar can be done with the attribute subarray, as shown below. Maybe something similar can be done in the SQL Search module somewhere? Didn't track it down, though.

<?php
$form
['date_field'] = array(
    
'#type' => 'textfield',
    
'#size' => 40,
    
'#title' => 'Start date',
    
'#description' => t('Click the calendar icon.'),
    
'#attributes' => array('class' => 'jscalendar'),
    
'#jscalendar_ifFormat' => '%d/%m/%Y',
    
'#jscalendar_showsTime' => false,
    
'#jscalendar_timeFormat' => '24',
);
?>
nobody click here