I am using .replace and .shift method to increment/decrement an arrow date. However the behaviour is completely unexpected. See the python session below as example.
>>> import arrow
>>> ref = arrow.get('2019-08-01', 'YYYY-MM-DD')
>>> ref.weekday()
3
>>> ref.day
1
>>> ref.shift(days=1)
<Arrow [2019-08-02T00:00:00+00:00]>
>>> ref.weekday()
3
>>> ref.day
1
>>> ref
<Arrow [2019-08-01T00:00:00+00:00]>
>>>
After I shifted the arrow by one day I would expect weekday and day properties to be incremented. However they stay the same. Any explanation to this?
Using replace does the same thing.
Try this:
ref = ref.shift(days=1)
shift doesn't update the object, it returns an updated object...