Date Placeholders | Community
Skip to main content

Date Placeholders

  • December 11, 2023
  • 7 replies
  • 0 views

Jill13

Is there a way to create a date placeholder for next business day using Monday-Friday as main operation days?

7 replies

  • December 14, 2023

Hi Jill,

To create a date placeholder for the next business day in Zendesk, you can use the Liquid markup language to add one day to the current date and check if it is a weekday. For example, you can use the following syntax to display the next business day in YYYY-MM-DD format:

{% capture tomorrow %} {{'now' | date:'%Y-%m-%d' | plus: 86400}} {% endcapture %} {% if tomorrow | date: '%a' == 'Sat' %} {% capture next_business_day %} {{tomorrow | plus: 172800}} {% endcapture %} {% elsif tomorrow | date: '%a' == 'Sun' %} {% capture next_business_day %} {{tomorrow | plus: 86400}} {% endcapture %} {% else %} {% capture next_business_day %} {{tomorrow}} {% endcapture %} {% endif %} {{next_business_day}}

This will output something like this:

2023-12-15

For more information on how to use date placeholders in Zendesk, you can check out these resources:

I hope this helps. If you have any other questions, feel free to ask me. 😊


Jill13
  • Author
  • December 14, 2023

Thanks @brandon34 When using this I don't seem to be receiving 2023-12-15 but getting 261223 any suggestions? 


  • December 14, 2023

Sorry @jill13, I should have tested first to confirm what my brain said was right :) 

Here's the revised markup that I've tested and outputs correctly:


{% assign current_day_of_week = 'now' | date: "%w" %} {% assign days_to_add = 1 %} {% if current_day_of_week == '5' %} {% assign days_to_add = 3 %} {% elsif current_day_of_week == '6' %} {% assign days_to_add = 2 %} {% endif %} {% assign seconds_in_a_day = 86400 %} {% assign additional_seconds = days_to_add | times: seconds_in_a_day %} {% assign next_business_day = 'now' | date: "%s" | plus: additional_seconds %} Next Business Day: {{ next_business_day | date: "%Y-%m-%d" }}


Jill13
  • Author
  • December 14, 2023

@brandon34 You're the best, it works! :-) 


Brett13
  • Community Manager
  • December 14, 2023

Awesome solution @brandon34! Thanks for taking the time to share this with Jill :) 


  • May 2, 2024

Why is this question downvoted? Most people would struggle to find a solution to this, including me (a programmer) since I am not too familiar with liquid markup. Thank you Jill for the question and Brandon for the solution! I was able to adjust the solution to my needs.


My pleasure @jack38 ! I'm not sure why this was downvoted so much either 🤔 @brett13 any idea why folks dislike this post?