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.

A simple date fieldtype for Grid (without TIME STAMP!) ?

December 31, 2014 6:40pm

Subscribe [1]
  • #1 / Dec 31, 2014 6:40pm

    Victor Paredes

    7 posts

    I’ve looked all over for this and can’t seem to find anything for this. I’ve also found an unresolved similar question about this in stack exchange from many months ago that wasn’t answered, so I thought I’d put this forward again.

    Is there a simple date picker that will work as a Grid field that will output ONLY the date without the time? All I need is Month, Day, and Year in any order so I can use the search: option in the Grid loop without having to use the “format” parameter.

    I know there is a way to build a fieldtype to do this, but I’m not this advanced (yet) with PHP (still learning on Lynda and looking at this stuff makes my head spin, so I think I’m still pretty far off from understanding it!)

    I have attempted to modify two existing fieldtype add-ons as well as the default date fieldtype without any luck. There’s always some issue: the field type won’t display datepicker when in Grid, the fieldtype won’t output properly in the front-end, or the fieldtype just spits out tons of PHP errors.

    Finally I want to point out that there are quite a few people who have been dealing with this issue and I honestly cannot believe that this is still an issue. Why isn’t there a field type available like this built into ee? Matching up dates without a very specific timestamp seems like a pretty ordinary task to want to accomplish without having to hack code all up.

    This is an add-on I would gladly pay for if it were available on devot:ee! (hopefully someone wants to make a quick buck)

    I would HIGHLY appreciate any help!

  • #2 / Jan 01, 2015 12:22am

    Werner Gusset

    122 posts

    Hi Victor

    You might want to check out Event Helper. Have used this one - not in a grid in my case. It should work in a grid according to the compatibility information.

    Werner

  • #3 / Jan 04, 2015 8:46pm

    Victor Paredes

    7 posts

    Werner,

    Thanks for the solution! I was able to use the field type from Event Helper to achieve the solution that I was looking for:

    {grid search:dateinfo="<?php echo strtotime('1/2/15'); ?>"}
         <b>date2: {grid:title}
    
            <b>dateinfo: {grid:dateinfo}
    
    
        {/grid}

    The actual Event Helper extension still needs to be updated for the new EE version (I’m running 2.9.2) or it will create PHP errors, so I recommend installing only the field type.

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

ExpressionEngine News!

#eecms, #events, #releases