Last Friday of each month: Difference between revisions

Content added Content deleted
Line 86: Line 86:




<lang AppleScript>on run
<lang AppleScript>on run argv
-- Default range in absence of arguments: from two years ago, to two years ahead
-- Up to two optional command line arguments: [yearFrom], [yearTo]
-- ~ $ osascript ~/Desktop/lastFridays.scpt
--
-- ~ $ osascript ~/Desktop/lastFridays.scpt 2013
--
-- ~ $ osascript ~/Desktop/lastFridays.scpt 2013 2016
set intThisYear to year of (current date)
if class of argv is list then
set lngArgs to length of argv
if lngArgs > 0 then
if lngArgs > 1 then
set {intFrom, intTo} to argv
else
set intYear to item 1 of argv
set {intFrom, intTo} to {intYear, intYear}
end if
else
set {intFrom, intTo} to {intThisYear - 2, intThisYear + 2}
end if
else
set {intFrom, intTo} to {intThisYear - 2, intThisYear + 2}
end if
intercalate(linefeed, ¬
intercalate(linefeed, ¬
map(isoRow, ¬
map(isoRow, ¬
transpose(map(lastFridaysOfYear, range(2012, 2016)))))
transpose(map(lastFridaysOfYear, range(intFrom, intTo)))))
end run
end run
Line 229: Line 257:
{{Out}}
{{Out}}


<pre>2012-01-27 2013-01-25 2014-01-31 2015-01-30 2016-01-29
<pre>2014-01-31 2015-01-30 2016-01-29 2017-01-27 2018-01-26
2012-02-24 2013-02-22 2014-02-28 2015-02-27 2016-02-26
2014-02-28 2015-02-27 2016-02-26 2017-02-24 2018-02-23
2012-03-30 2013-03-29 2014-03-28 2015-03-27 2016-03-25
2014-03-28 2015-03-27 2016-03-25 2017-03-31 2018-03-30
2012-04-27 2013-04-26 2014-04-25 2015-04-24 2016-04-29
2014-04-25 2015-04-24 2016-04-29 2017-04-28 2018-04-27
2012-05-25 2013-05-31 2014-05-30 2015-05-29 2016-05-27
2014-05-30 2015-05-29 2016-05-27 2017-05-26 2018-05-25
2012-06-29 2013-06-28 2014-06-27 2015-06-26 2016-06-24
2014-06-27 2015-06-26 2016-06-24 2017-06-30 2018-06-29
2012-07-27 2013-07-26 2014-07-25 2015-07-31 2016-07-29
2014-07-25 2015-07-31 2016-07-29 2017-07-28 2018-07-27
2012-08-31 2013-08-30 2014-08-29 2015-08-28 2016-08-26
2014-08-29 2015-08-28 2016-08-26 2017-08-25 2018-08-31
2012-09-28 2013-09-27 2014-09-26 2015-09-25 2016-09-30
2014-09-26 2015-09-25 2016-09-30 2017-09-29 2018-09-28
2012-10-26 2013-10-25 2014-10-31 2015-10-30 2016-10-28
2014-10-31 2015-10-30 2016-10-28 2017-10-27 2018-10-26
2012-11-30 2013-11-29 2014-11-28 2015-11-27 2016-11-25
2014-11-28 2015-11-27 2016-11-25 2017-11-24 2018-11-30
2012-12-28 2013-12-27 2014-12-26 2015-12-25 2016-12-30</pre>
2014-12-26 2015-12-25 2016-12-30 2017-12-29 2018-12-28</pre>


=={{header|AutoHotkey}}==
=={{header|AutoHotkey}}==