/isWeekday

This endpoint is used to determine whether a given date falls on a weekday or a weekend. Users can specify the date format as either “MM/DD/YYYY” or “DD/MM/YYYY”.

Endpoint

POST https://node.nodetrigger.com/isWeekday

Request Body

The request should include a JSON body with the following fields:

  • date (string, required): The date to be checked.
  • format (string, required): The format of the date. It can be either “MM/DD/YYYY” or “DD/MM/YYYY”.

Example JSON Body

{
    "date": "06/09/2024",
    "format": "MM/DD/YYYY"
}

Response

The response will be a JSON object with the following fields:

  • is_weekday (string): “Yes” if the date is a weekday, “No” if it is a weekend.
  • day (string): The name of the day of the week (e.g., “Monday”).

Example Response

{
    "is_weekday": "Yes",
    "day": "Monday"
}

Usage

To use this endpoint, send a POST request to the URL with the appropriate JSON body.

Examples

Example 1: Checking a Weekday

Request

POST https://node.nodetrigger.com/isWeekday

Body

{
    "date": "06/10/2024",
    "format": "MM/DD/YYYY"
}

Response

{
    "is_weekday": "Yes",
    "day": "Monday"
}

Example 2: Checking a Weekend

Request

POST https://node.nodetrigger.com/isWeekday

Body

{
    "date": "15/06/2024",
    "format": "DD/MM/YYYY"
}

Response

{
    "is_weekday": "No",
    "day": "Saturday"
}