Last Friday of each month: Difference between revisions

→‎{{header|Ruby}}: Replaced active_support version, date class recently got its own convenience methods.
m (→‎{{header|REXX}}: changed/added comments and whitespace, changed indentations, moved documentation for the lastDOW function to a separate window.)
(→‎{{header|Ruby}}: Replaced active_support version, date class recently got its own convenience methods.)
Line 2,133:
</pre>
 
Or get the last day of the month and go to the previous day until it's friday.
{{libheader|ActiveSupport}}
<lang ruby>require 'activesupportdate'
Using the ActiveSupport library for some convenience methods
 
<lang ruby>require 'activesupport'
 
def last_friday(year, month)
d = Date.new(year, month, -1).end_of_month
untild = d.wdayprev_day ==until 5d.friday?
d = d.yesterday
end
d
end</lang>
</lang>
 
=={{header|Run BASIC}}==
1,149

edits