Date.dateWithDaysBeforeNow()

  1. 5 months ago

    Joel_Eisenstat

    May 28 User since 2016

    I require to set the date to the first day of the month for various dates. Can the dateWithDaysBeforeNow() func be used for other than the current date ? Tried someDate.dateWithDaysBefore(Int) but it seems to always default to Date(). The workaround is to convert the date to a string and inject '01' using split and then back to a date object . My lazy side is looking for an easier way ;)
    TIA

  2. Joel_Eisenstat

    May 28 User since 2016

    of course got it after hitting send :(
    current.dateBySubtractingDays(day)

or Sign Up to reply!