previousWeekDay()
Table of Contents
Overview
The previousWeekDay() function takes an inputDate and returns the previous week's date that falls on the specified inputDay. For example, to get the previous week's date that falls on a Monday, specify the inputDate as zoho.currentDate and inputDay as Monday.
Return Type
- TEXT
Syntax
<variable> = <inputDate>.previousWeekDay(<inputDay>);
(OR)
<variable> = previousWeekDay(<inputDate>, <inputDay>);
Parameter | Data type | Description |
---|---|---|
<variable> | DATE-TIME | Variable which will contain the returned date. |
<inputDate> | DATE-TIME | The input start date. |
<inputDay> | TEXT | The text that represents the day on which the required date falls. Allowed Values:
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.previousWeekDay("Monday"); //Considering current date is 21-Jul-2021, it returns 19-Jul-2021 inputDate = '21-Jul-2021'; //Is a Wednesday info inputDate.previousWeekDay("Wednesday"); //Returns 14-Jul-2021