"Or" condition doesn't worn in Liquid code

Topic summary

A developer is struggling to implement an “or” condition in Liquid code for date manipulation.

Working code: Successfully checks if a date is Sunday and adjusts it to the next Monday.

Non-working code: Attempts to check if the date is either Sunday OR Saturday using the || operator, but fails to execute properly.

Note: The code snippets in both the original post and the response appear corrupted or reversed (text appears backwards), making it difficult to verify the exact syntax being used.

Response provided: PageFly-Richard suggests using the || operator for the OR condition, though the provided code snippet is also affected by the same text reversal issue.

Status: The thread appears to be seeking clarification on proper OR syntax in Liquid, but the formatting issues may be hindering effective troubleshooting.

Summarized with AI on November 22. AI used: claude-sonnet-4-5-20250929.

Hello, For the life of me I cannot find a way to introduce an “or” condition that works.

Code that works

var fromDate = Date.today().addDays(2);
if (fromDate.is().sunday()) {
fromDate = fromDate.next().monday();
}

Code that doesn’t work:

var fromDate = Date.today().addDays(3);
if (fromDate.is().sunday() or fromDate.is().saturday()) {
fromDate = fromDate.next().monday();
}
1 Like

Hi @Snow_Wolf ,

This is Richard from PageFly - Landing page builder, I’d like to suggest this idea:

You can try below code:

var fromDate = Date.today().addDays(3);
if (fromDate.is().sunday() || fromDate.is().saturday()) {
fromDate = fromDate.next().monday();
}

I hope it would help you
Best regards,

Richard | PageFly

1 Like