wolfram-language

How can I apply a function on each date in an Interval[DateObject[],DateObject[]] in Wolfram-Language?


Line 2 of the following code:

dates = Interval[DateObject[{2019, 7, 5}],DateObject[{2019, 7, 7}]]
Map[Function[d,DateValue[d,"DayNameShort"]],dates]

yields:

Interval[Fri,Sun]

... but I want to give:

{Fri,Sat,Sun}

... how can I 'peel off' each day (not millisecond!) which falls within the interval?


Solution

  • Use DateRange[d1,d2] instead of Interval[d1,d2]!