Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Problems with cb:parse +1day

  • brimberry
  • brimberry
  • OFFLINE
  • Posts: 14
  • Thanks: 0
  • Karma: 0
9 years 3 months ago - 9 years 3 months ago #268100 by brimberry
Problems with cb:parse +1day was created by brimberry
Hey i tried this in CB Auto Actions:

[cb:parse function="date" format="Y-m-d H:i:s"][cb:parse function="time" format="+1 DAY"][lastvisitdate][/cb:parse][/cb:parse]

But it don't show me +1 Day. I tried the After Login Trigger and the E-Mail Action for example:

If [lastvisitdate] is 2015-07-27 09:18:20, than +1 Day have to be 2015-07-28 09:18:20. But the output is only 1:56:42 later: 2015-07-27 11:15:02

What is wrong?

Input:
Lastupdatedate: [lastupdatedate]
Lastupdatedate +1 Tag: [cb:parse function="date" format="Y-m-d H:i:s"][cb:parse function="time" format="+2 DAY"][lastvisitdate][/cb:parse][/cb:parse]
Lastupdatedate time +1: [cb:parse function="time" format="+2 DAY"][lastvisitdate][/cb:parse]
Lastupdatedate date +1: [cb:parse function="date" format="Y-m-d H:i:s"][lastvisitdate][/cb:parse]
current time +1: [cb:parse function="time" format="+2 DAY"][cb:date format="Y-m-d H:i:s" /][/cb:parse]
current date +1: [cb:parse function="date" format="Y-m-d H:i:s"][cb:date format="Y-m-d H:i:s" /][/cb:parse]
Current: [cb:date format="Y-m-d H:i:s" /]
Current+1Day: [cb:date format="+2 DAY" /]
PHP-Time: strtotime(+2 DAY,strtotime([lastvisitdate]))


Output:

Lastupdatedate: 2015-07-26 17:01:45
Lastupdatedate +1 Tag: [cb:parse function="date" format="Y-m-d H:i:s"][cb:parse function="time" format="+2 DAY"]2015-07-27 07:41:43[/cb:parse][/cb:parse]
Lastupdatedate time +1: [cb:parse function="time" format="+2 DAY"]2015-07-27 07:41:43[/cb:parse]
Lastupdatedate date +1: [cb:parse function="date" format="Y-m-d H:i:s"]2015-07-27 07:41:43[/cb:parse]
current time +1: [cb:parse function="time" format="+2 DAY"]2015-07-27 09:43:53[/cb:parse]
current date +1: [cb:parse function="date" format="Y-m-d H:i:s"]2015-07-27 09:43:53[/cb:parse]
Current: 2015-07-27 09:43:53
Current+1Day: +2 MonAM2015
PHP-Time: strtotime(+2 DAY,strtotime(2015-07-27 07:41:43))

System:
Joomla 4.3.4., CB 2.0.10, AutoActions: 6.3.1
Last edit: 9 years 3 months ago by brimberry.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
9 years 3 months ago #268136 by krileon
Replied by krileon on topic Problems with cb:parse +1day
Your parser usage isn't valid. Please read the format function usage information at the bottom of the page carefully. Each parser usage is provided with an example and explanation of each of its parameters. The below will work fine.

[cb:parse function="date" date-format="Y-m-d" time-format=" H:i:s"][cb:parse function="time" time="+1 DAY"][lastvisitdate][/cb:parse][/cb:parse]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

  • brimberry
  • brimberry
  • OFFLINE
  • Posts: 14
  • Thanks: 0
  • Karma: 0
9 years 3 months ago - 9 years 3 months ago #268146 by brimberry
Replied by brimberry on topic Problems with cb:parse +1day
Failed:

Input:
Lastvisitdate: [lastvisitdate]

CB Forum Test:
[cb:parse function="date" date-format="Y-m-d" time-format=" H:i:s"][cb:parse function="time" time="+1 DAY"][lastvisitdate][/cb:parse][/cb:parse]

Output:
Lastvisitdate: 2015-07-27 16:36:29 CB Forum Test: [cb:parse function="date" date-format="Y-m-d" time-format=" H:i:s"][cb:parse function="time" time="+1 DAY"]2015-07-27 16:36:29[/cb:parse][/cb:parse]
Last edit: 9 years 3 months ago by brimberry.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
9 years 3 months ago #268157 by krileon
Replied by krileon on topic Problems with cb:parse +1day
You need to enable Format Functions under the Parameters tab. They are heavy to parse and by default only apply to Conditions. For them to apply to the Action it self you must enabled it under Parameters.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: nant

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

Moderators: beatnantkrileon
Powered by Kunena Forum