[SOLVED] Very strange date comparison in Auto Action

6 years 6 months ago #297442 by krileon
Replied by krileon on topic Very strange date comparison in Auto Action

I got some debug output, but I had to modify the users url trigger and remove the &format=raw at the end.

Raw format doesn't have a message queue output.

:: Action 164 :: Conditional 2 failed for 322: 01-18 Equal to [cb:date format="m-d" offset="UTC"/]
So that doesn't really work either.

Sorry, offset doesn't exist for cb:date; thought it did, but was confusing the format function with core substitution. There's no way to stop it from offsetting. You'll need to use the below format function.

[cb:parse function="date" date-format="m-d" time="false"]now[/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 to join the conversation.

6 years 6 months ago #297448 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action

krileon wrote:

I got some debug output, but I had to modify the users url trigger and remove the &format=raw at the end.

Raw format doesn't have a message queue output.

It might be considered a bit arrogant to expect me as a 'non joomla programmer' to know that, despite that I've used Joomla for some time...

krileon wrote:

:: Action 164 :: Conditional 2 failed for 322: 01-18 Equal to [cb:date format="m-d" offset="UTC"/]
So that doesn't really work either.

Sorry, offset doesn't exist for cb:date; thought it did, but was confusing the format function with core substitution. There's no way to stop it from offsetting. You'll need to use the below format function.
[cb:parse function="date" date-format="m-d" time="false"]now[/cb:parse]

Ok, now I got some output that looks correct.

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

6 years 6 months ago #297449 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
With the above result in mind I have to go through all the date comparisons I do here.
Is it possible to test current date with just:
[cb:parse function="date" date-format="m-d" time="false"]now[/cb:parse] EQUAL TO 09-30
Or do I need to format the date I need to check somehow?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

6 years 6 months ago #297452 by krileon
Replied by krileon on topic Very strange date comparison in Auto Action

With the above result in mind I have to go through all the date comparisons I do here.
Is it possible to test current date with just:
[cb:parse function="date" date-format="m-d" time="false"]now[/cb:parse] EQUAL TO 09-30

That'll work fine.


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: fribse2011

Please Log in to join the conversation.

6 years 6 months ago #297453 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
One more short question, can I also use 'Greater Than Or Equal To' on that, or will that fail?
Something like:
[cb:parse function="date" date-format="m-d" time="false"]now[/cb:parse] GREATER THAN OR EQUAL TO 09-30

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

6 years 6 months ago #297456 by krileon
Replied by krileon on topic Very strange date comparison in Auto Action

One more short question, can I also use 'Greater Than Or Equal To' on that, or will that fail?

No, that'll only work for integer or float comparisons. You'd need the timestamp to be able to do that, which you can get using the time format function. Note that converting from string to time just utilizes strtotime basically and you need to provide a validate date (of which 09-30 is not as it has no year).


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: fribse2011

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.231 seconds

Facebook Twitter LinkedIn