ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Date field - Stand Alone Entry Form / SAEF

July 15, 2010 1:20pm

Subscribe [9]
  • #1 / Jul 15, 2010 1:20pm

    dzr_rtw

    86 posts

    I have a Stand Alone Entry Form and want the user to be able to pick a date - ideally from a calendar like the JQuery Date UI. It would be unacceptable to have the user pick minutes and seconds.

    I saw this: http://devot-ee.com/add-ons/blind-date/ but it’s not for EE 2.

    What does everyone else do?

    ANY help would be great!!!!

  • #2 / Jul 21, 2010 11:39pm

    MacMastermind

    118 posts

    I would love to hear this answer as well.  I either need this or some kind of input mask to avoid an invalid entry format…

    -Tony

  • #3 / Jul 22, 2010 11:24am

    dzr_rtw

    86 posts

    I tried everything I could think of an ended up just hard coding the form. I changed the date field to a regular text input field and put a javascript date picker on that.

    The end user could still monkey with the formatting or type in and submit anything but it’s as close as I could get. Luckily my form doesn’t require any sort of time calculations so text input was fine.

    BTW - most javascript did not work (no calendar would show for date selection) in any page that had “” tags. I did get this one to work http://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-widgit-update/—the problem with that is still the additional minutes, seconds & AM/PM that’s required. Some one might be able to get that date picker to produce the format.

    Hopefully the folks at EE will consider this important enough to sort it out.

  • #4 / Jul 26, 2010 3:57pm

    rt30000

    125 posts

    I am using the jQuery datepicker on a form on the front-end of my site. I added the link to jquery, jquery UI core, and jQuery datepicker. I set a class to convert to a datepicker and it works.

    {exp:jquery:script_tag}
        {exp:jquery:script_tag ui='core'}
        {exp:jquery:script_tag ui='datepicker'}
        [removed]
            $(document).ready(function(){
                $(".datepicker").datepicker();
            });
        [removed]

    ...and the text input field…

    <input type="text" name="event_date" class="datepicker" />

    (The [removed] in the code is the javascript open and close tags)

  • #5 / Oct 02, 2010 6:24pm

    11Media

    157 posts

    Thanks for posting…

    I’ve got the pop-up calendar working, but it’s not adding time e.g. 0:00 PM - so it’s causing the form to not post as it’s an invalid format.


    Any ideas to why the time isn’t being added to the date?

    It doesn’t have to be a “dynamic date” - if it some how just adds the 0:00 AM - after the date somehow (Visible to the user or not) then that’s fine.

    Cheers,

  • #6 / Oct 04, 2010 5:39pm

    John St-Amand

    865 posts

    I’m struggling with this one too - anyone have a good example of applying a date picker to a date field on a Stand-alone Entry Form in EE 1.X? IS there no way to access the same one used in the CP on the SAEF side of things?

  • #7 / Jan 10, 2011 1:25pm

    jtoast

    32 posts

    Same question for me as John above. “anyone have a good example of applying a date picker to a date field on a Stand-alone Entry Form in EE 1.X? IS there no way to access the same one used in the CP on the SAEF side of things?”

    Thanks!

  • #8 / Jan 19, 2011 1:28pm

    Eastwood Design

    605 posts

    I’m struggling with this one too - anyone have a good example of applying a date picker to a date field on a Stand-alone Entry Form in EE 1.X? IS there no way to access the same one used in the CP on the SAEF side of things?

    Jean did you ever find something for this?  I am trying to create a custom entry date (ie: in the future) using an SAEF and it MUST be able to include the hour/minutes etc.

    I am trying to use a simple text field. When the page loads it is defaulting to the current date/time, and if I change it to the future and submit the form it is still entered as the current date.

  • #9 / Jan 24, 2011 1:02am

    xenowebdev

    34 posts

    Hey guys,

    I’ve got a version working using the jquery UI DatePicker and TimePicker.

    I’ve created a weblog called ‘Events’ which among other fields has two ‘date’ fields - event_date_start (field id 14) and event_date_finish (field id 15).

    I’m using the standard ‘weblog:entry_form’.

    I’ve attached a zip containing all the files:

    template
    css files
    jquery files


    pm me if something is missing though.

    This is for EE1.x


    Edit:
    You will need to add the ‘format’ tag to your date field when displaying the value in the front-end
    Starts:

    {event_date_start format="%D, %F %d, %Y - %g:%i:%s"}

    Finishes:

    {event_date_finish format="%D, %F %d, %Y - %g:%i:%s"}
  • #10 / Feb 21, 2011 9:47am

    benbeilharz

    51 posts

    If you just want to add an arbitrary time to get past validation you can use this date format:

    $(document).ready(function(){
        $("#datepicker").datepicker({dateFormat: 'yy-mm-dd 00:00:00'});
    });

    There is a happy loophole where the 00:00:00 format is accepted by the SAEF. You can’t use 0:00 AM because the M is converted into the short month name…

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases