Dataface date problem ("2011") [SOLVED]

A place for users and developers of the Xataface to discuss and receive support.

Dataface date problem ("2011") [SOLVED]

Postby borghstijn » Tue Jan 11, 2011 9:32 am

Hi guys,

we have dataface running on our website as a 'backoffice' for our database. It's the old one, dataface, not xataface :P I think it's 0.7.1 according to the change.txt - Never needed to update it i guess ;)

Anyways, we now have the strange problem that the date widget in our forms doesn't know it's 2011 - it only ranges from 2001 to 2010! I have no real experience with this kind of projects, and the dataface implimentation was my first and last try at it (so it must be somewhat easy haha)

- Can someone help me out here? I'm guessing it's just a simple modification somewhere - but *where*?

Thanks!

edit: Ah i solved it :P in dataface\lib\HTML\QuickForm\date.php is a min and a max year :)
borghstijn
 
Posts: 1
Joined: Tue Jan 11, 2011 9:26 am

Re: Dataface date problem ("2011") [SOLVED]

Postby FractalizeR » Tue Oct 04, 2011 5:29 am

This is still the case for latest 1.3rc6 xataface release. I had to change it manually also.
FractalizeR
 
Posts: 19
Joined: Tue Oct 04, 2011 5:26 am

Re: Dataface date problem ("2011") [SOLVED]

Postby shannah » Tue Oct 04, 2011 9:29 am

Thanks. I've posted this in the issue tracker. I haven't used the date widget in ages.
http://bugs.weblite.ca/view.php?id=852
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Dataface date problem ("2011") [SOLVED]

Postby ADobkin » Tue Oct 04, 2011 2:58 pm

I often use the date widget for time fields rather than the default time widget, because it uses separate selectors for hours, minutes, am/pm, etc. The time widget, on the other hand, combines them into a long list, which requires a lot of scrolling, especially if the interval is smaller than 30 minutes.

Regarding the maxyear limitation, I agree that this should be extended in the date widget source code. But it can also be changed easily on a per-field basis in the fields.ini file. I set mine up that way a few years ago, so I never noticed this bug. Simply add the following line to any fields using the date widget to extend the years to 2020:

widget:maxYear = 2020

Alan
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA

Re: Dataface date problem ("2011") [SOLVED]

Postby FractalizeR » Tue Oct 04, 2011 11:17 pm

widget:maxYear is not documented here. Should it be?

I have also discovered, that all the options listed at QuickForm component are available to be provided as widget:XXXX in fields.ini. For example, for widget:type = date they are:

Code: Select all
    var $_options = array(
        'language'         => 'en',
        'format'           => 'dMY',
        'minYear'          => 2010,
        'maxYear'          => 2020,
        'addEmptyOption'   => false,
        'emptyOptionValue' => '',
        'emptyOptionText'  => ' ',
        'optionIncrement'  => array('i' => 1, 's' => 1)


So, I've added to one of my fields the following:

Code: Select all
widget:type = date
widget:minYear = 2009
widget:maxYear = 2014
widget:format = "dmYHis"


And it works!

I think this should be explicitly documented somewhere around fields.ini
FractalizeR
 
Posts: 19
Joined: Tue Oct 04, 2011 5:26 am

Re: Dataface date problem ("2011") [SOLVED]

Postby shannah » Tue May 08, 2012 3:34 pm

I have fixed this in SVN. Will be included with 1.3.3
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 9 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved