Empty Date displays default date
21 posts by 5 authors in: Forums > CMS Builder
Last Post: August 24, 2011 (RSS)
By trebien - August 15, 2011
Any thoughts?
Re: [trebien] Empty Date displays default date
By Steve99 - August 16, 2011
Go to Admin -> Section Editors, and click modify on your "events" editor. Then click modify for your date field. In the Field Options area, change the default value to "None/Blank" and that should do the trick!
Hope this helps.
Re: [steve99] Empty Date displays default date
By trebien - August 17, 2011
We also tried changing that option, saving... then changing it back... but same thing... weird.
Re: [trebien] Empty Date displays default date
By Steve99 - August 17, 2011
Example:
New Field = display_date (checkbox in your section editor)
Inside your "foreach" loop around your date output:
<?php if ($record['display_date'] == 'Yes'): ?>
<?php echo $record['date'] ?>
<?php endif ?>
Re: [steve99] Empty Date displays default date
By trebien - August 17, 2011
Re: [trebien] Empty Date displays default date
By robin - August 17, 2011
Are you directly outputting the date field? Like
<?php echo $record['date'] ?>
Or are you running it through any functions first?
Thanks,
Robin
Programmer
interactivetools.com
Re: [robin] Empty Date displays default date
By trebien - August 17, 2011
<?php echo date("D, M jS, Y g:i a", strtotime($record['date'])) ?>
Re: [trebien] Empty Date displays default date
By robin - August 17, 2011
Thanks
Programmer
interactivetools.com
Re: [trebien] Empty Date displays default date
Try the removeExtraWhitespace plugin that Dave Edis created (attached).
It automatically checks for fields that only contain blank spaces as well as blank dates.
The plugin requires 2.05
That should get you going,
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php