Choose where you’d like to start

nextWeekDay()

Overview

The nextWeekDay() function takes an inputDate and returns the next immediate date that falls on the specified inputDay. For example, to get the next date that falls on a Monday, specify the inputDate as zoho.currentDate and inputDay as Monday.

Return Type

  • TEXT

Syntax

<variable> = <inputDate>.nextWeekDay(<inputDay>);

(OR)

<variable> = nextWeekDay(<inputDate>, <inputDay>);
ParameterData typeDescription
<variable>DATE-TIMEVariable which will contain the returned date.
<inputDate>DATE-TIMEThe input start date.
<inputDay>TEXT

The text that represents the day on which the required date will fall.

Allowed Values:

  • Sunday
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday 
  • Saturday
Note: This function is not related to business days. inputDay param can take any day including weekends and return the next immediate date that falls on the specified day.

Example 

info zoho.currentdate.nextWeekDay("Monday"); // Considering current date is 20-Jul-2021, it returns 26-Jul-2021  
 
inputDate = '20-Jul-2021'; //Is a Tuesday 
info inputDate.nextWeekDay("Tuesday"); //Returns 27-Jul-2021
 

Related Links

Get Started Now

Execute