TOPIC:

Time & Date field. 3 years 5 months ago #226985

  • Topic Author
  • mdourou
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 76
  • Thanks: 1
Hi,

I have a form in Breezing Form which formatted as 24hrs for time and YYYY-MM-DD for date. so I'm trying to display the records in Content Builder to have the time in 12hrs format like 18:00 to be 6:00 PM and for the date to display as Dec 1, 2018. I want it both in record list view and content template view. Kindly see screenshot attached.

Hoping to see your soonest reply.

Best regards,
Mohammad
Attachments:

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

Time & Date field. 3 years 5 months ago #227018

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

Here is how to achieve what you want.
Hello,

Please go to ContentBuilder view created for that form. Go to the View tab and in the Item wrap code for that date element paste in this code:
<?php  $value=date("M jS, Y", strtotime($value));?>

That will make the date display the wanted way in the List view.

To make the date display that way also when you enter a certain record do as follows.
Go to Content Prepare and paste in this code:
$items["datefieldname"]["value"]=date("M jS, Y", strtotime($items["datefieldname"]["value"]));
NOTE: In the code above replace both instances of datefieldname with the Name of that field for Extra Details.

To do the same for time field in the Item wrap code put this code:
<?php $value= date('h:i a', strtotime($value)); ?>
In the Content Prepare and paste in this code:
$items["timefieldname"]["value"]=date("h:i a", strtotime($items["timefieldname"]["value"]));

Let me know if this works how you wanted.
If date and time fields are not mandatory, then the code will be a bit different.
If you have more questions, feel free to ask.

Regards,

Mihaela

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

Time & Date field. 3 years 5 months ago #227080

  • Topic Author
  • mdourou
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 76
  • Thanks: 1
Hi Mihaela,

Your solutions was perfect. It works very well. Kindly see attached screenshot. Thank you! I really appreciate your quick reply.

Best regards,
Mohammad
Attachments:

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

Time & Date field. 3 years 5 months ago #227107

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Great!
I'm glad I've helped and that this works how you wanted.

Best regards,

Mihaela

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.045 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!