SwiftDate icon indicating copy to clipboard operation
SwiftDate copied to clipboard

Binary operator '+' cannot be applied to operands of type 'DateInRegion' and 'Date'

Open hansong8675 opened this issue 4 years ago • 0 comments

    let date1 = ("2010-05-20 15:30:00".toDate()! + 3.months - 2.days)
    print("date1"+(date1.description ))
    let date2 = Date() + 3.hours
    print("date2"+(date2.description ))
    let date3 = date1 + [.year:1, .month:2, .hour:5]

⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️XXXXXXXXXX let date4 = date1 + date2 ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️XXXXXXXXXX // extract single time unit components from date manipulation let over1Year = (date3 - date2).year > 1

hansong8675 avatar Oct 21 '20 09:10 hansong8675