diff options
author | Andinus <andinus@nand.sh> | 2020-05-29 20:36:36 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-05-29 20:36:36 +0530 |
commit | ba6f1e741dbec3812edaf47e97b9aa146b3ecf98 (patch) | |
tree | 34b323296aa5abdda96c33ce05f33f84cd7530e3 /ara.pl | |
parent | 870fe4d811c4bf2f35b4b6e1d356adb51db2878e (diff) | |
download | ara-ba6f1e741dbec3812edaf47e97b9aa146b3ecf98.tar.gz |
Fix datetime check, clone before subtract/add
subtract/add modifies in place so we clone it.
Diffstat (limited to 'ara.pl')
-rwxr-xr-x | ara.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ara.pl b/ara.pl index 970e398..6779d7f 100755 --- a/ara.pl +++ b/ara.pl @@ -74,10 +74,10 @@ foreach my $i (0...37) { if ( substr( $lastupdatedtime, 0, 10 ) eq $today->dmy('/') ) { $update_info = "Today"; } elsif ( substr( $lastupdatedtime, 0, 10 ) eq - $today->subtract( days => 1 )->dmy('/') ) { + $today->clone->subtract( days => 1 )->dmy('/') ) { $update_info = "Yesterday"; } elsif ( substr( $lastupdatedtime, 0, 10 ) eq - $today->add( days => 1 )->dmy('/') ) { + $today->clone->add( days => 1 )->dmy('/') ) { $update_info = "Tomorrow"; # Hopefully we don't see this. } else { $update_info = |