TOPIC:

Using a Date Field in the Menu Function to Include Specific Records in List 1 year 2 months ago #244222

  • bruce@brucedill.com's Avatar Topic Author
  • bruce@brucedill.com
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 1182
  • Karma: 1
  • Thanks: 9
I have a date field in a Form. If entries_close_date is <= "Today's Date" then include in list.

How do I do this?

Thanks again for all the help.

Please Log in or Create an account to join the conversation.

Using a Date Field in the Menu Function to Include Specific Records in List 1 year 2 months ago #244237

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6888
  • Karma: 3
  • Thanks: 492
Hi,

in Item warp code for date field put this:
<?php  $today = strtotime(date('d-m-Y')); $data = strtotime($value); if($data<=$today) { $value=$value; } else { $value=""; } ?>

If the date entered <= today's date, it will be displayed in the list, otherwise an empty space in the list will appear. I hope this is ok for you.

Let me know if it works for you.

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Using a Date Field in the Menu Function to Include Specific Records in List 1 year 2 months ago #244259

  • bruce@brucedill.com's Avatar Topic Author
  • bruce@brucedill.com
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 1182
  • Karma: 1
  • Thanks: 9
OK that helps but I need to make sure I have the code correct.

My date field name is 'entries_close_date"
The format is "%Y-%m-%d"

So is the following correct?

<?php $today = strtotime(entries_close_date('Y-m-d')); $data = strtotime($value); if($data<=$today) { $value=$value; } else { $value=""; } ?>

Please Log in or Create an account to join the conversation.

Using a Date Field in the Menu Function to Include Specific Records in List 1 year 2 months ago #244261

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6888
  • Karma: 3
  • Thanks: 492
Hi,

Please try like this:
<?php  $today = strtotime(date('Y-m-d')); $data = strtotime($value); if($data<=$today) { $value=$value; } else { $value=""; } ?>

This is for today date:
$today = strtotime(date('Y-m-d'))

And this is for the date which is entered:
$data = strtotime($value);

Please test it and let me know if it works

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

Using a Date Field in the Menu Function to Include Specific Records in List 1 year 2 months ago #244262

  • bruce@brucedill.com's Avatar Topic Author
  • bruce@brucedill.com
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 1182
  • Karma: 1
  • Thanks: 9
Sorry didn't work. I have crosstec set up as a super user. Want to take a look?

Please Log in or Create an account to join the conversation.

Using a Date Field in the Menu Function to Include Specific Records in List 1 year 2 months ago #244263

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6888
  • Karma: 3
  • Thanks: 492
Hi,

this works for me, I tested it. Please send me your information on tk@evolutio-it.com, so i will take a look

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.051 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!