Check if a date falls on a weekend (Saturday or Sunday).
Code
Generalrequire 'date'
return Date.parse(dateStr).saturday? || Date.parse(dateStr).sunday?Parameters
Date to check (YYYY-MM-DD)
Server
More Ruby Snippets
Days in Month
Get the number of days in a specific month.
Get Current Timestamp
Get the current Unix timestamp in milliseconds.
Is Leap Year
Check if a year is a leap year.
Array Difference
Find elements in the first array that are not present in the second array.
Array Frequencies
Count how many times each value appears in an array and return a frequency map.
Array Head
Get the first n elements of an array.