set default time in date field

Jim,

Looks like the stuff you found is a slightly updated version of the standard J! calendar widget. I may or may not start using that.

I'm on the right track with solving the date format issue, by creating a custom version of the J! openCalendar() script.

The problem I've now run into is that the JS calendar widget takes it's date format string in UNIX standard format, whereas our date Elements use PHP standard date formats. Which means that something like ...

m-d-Y H:i:s

... needs to become ...

%m-%d-%Y %H:%M:%S

... and I can't find any handy dandy converter for the format strings. Looking for a workaround ...

-- hugh
 
Hugh,

I have a work around, for me anyway:

If you open the file public_html\includes\js\calendar\lang\calendar-en.js

you will find the following at line 42

Code:
Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
I appended it as follows:

Code:
Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd 00:00:00";

This seems to work, though I may update the time to midday and remove the PHP code so as not to confuse my end users with seeing "y-mm-dd 00:00:00" one minute and "y-mm-dd 12:00:00" the next!

Thanks + hopes this helps others,

Jim
 
I believe I fixed all the calendar related issues in SVN, as of a few days ago.

We're now using an updated version of calendar.js, and I wrote a function to convert PHP date formats to something calendar.js will understand. It means a few of the more esoteric codes available in PHP date formatting won't work (like "% seconds since epoch minus your mothers maiden name expressed as a Base64 hash"), but about 99% of formats people are likely to want in real life should work.

I'd appreciate it if you could test this for me. You should now be able to just set the date format in Fabrik to your preferred format, and it Should All Just Work.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top