0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions108

Overview

The "Is Weekend" operation in the Date & Time resource checks whether a given date falls on a weekend. This node is useful in workflows where actions depend on whether a date is a weekend or not, such as scheduling tasks, sending notifications only on weekdays, or adjusting business logic based on weekends.

For example, you might use this node to:

  • Determine if a delivery date is on a weekend and adjust shipping options accordingly.
  • Trigger different workflow branches depending on whether today is a weekend.
  • Calculate working days by filtering out weekends.

Properties

Name Meaning
Code Variables A collection of user-defined code variables with names/IDs and their corresponding values. These can be used within custom code functions in the node.
Date The date value to check if it is a weekend.
Date Format The format string describing the input date's format (optional).
Time Zone The time zone context for the date to accurately determine the weekend status (optional).

Output

The node outputs JSON data indicating whether the specified date is a weekend. The exact structure is not fully detailed in the source, but typically it would include fields such as:

  • isWeekend: Boolean indicating if the date is a weekend.
  • Possibly additional details like the day number or weekday name.

No binary data output is indicated for this operation.

Dependencies

  • Requires an API key credential for the external service powering the node's operations.
  • The node makes HTTP POST requests to an external API endpoint related to date and time utilities.
  • No other external dependencies or environment variables are explicitly required.

Troubleshooting

  • Invalid Date Format: If the provided date does not match the expected format, the node may fail or return incorrect results. Ensure the "Date Format" property matches the input date string.
  • Time Zone Issues: Incorrect or missing time zone information may lead to wrong weekend determination, especially near date boundaries. Specify the correct time zone if relevant.
  • API Authentication Errors: Missing or invalid API credentials will cause authentication failures. Verify that the API key credential is correctly configured.
  • Network or API Errors: Temporary network issues or API downtime can cause errors. Retry or check the external service status.

Links and References

  • n8n Expressions Documentation — for using expressions in properties like Code Variables.
  • General documentation on date formats and time zones (e.g., Moment.js or Luxon libraries) may help understand how to format dates properly.

Discussion