about summary refs log tree commit diff stats
path: root/ara.pl
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-05-29 19:50:23 +0530
committerAndinus <andinus@nand.sh>2020-05-29 19:50:23 +0530
commit870fe4d811c4bf2f35b4b6e1d356adb51db2878e (patch)
tree4f142983337f5cbc2d71e19101432c7f458060fa /ara.pl
parent2c9b603420dd69400561eaf1179727e7fe89037e (diff)
downloadara-870fe4d811c4bf2f35b4b6e1d356adb51db2878e.tar.gz
Add check for tomorrow in dates
Diffstat (limited to 'ara.pl')
-rwxr-xr-xara.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/ara.pl b/ara.pl
index 852bf4f..970e398 100755
--- a/ara.pl
+++ b/ara.pl
@@ -64,7 +64,6 @@ my $rows = [
     ];
 
 my $today = DateTime->now( time_zone => 'UTC' );
-my $yesterday = DateTime->now( time_zone => 'UTC' )->subtract( days => 1 );
 
 # Add first 37 entries to $rows.
 foreach my $i (0...37) {
@@ -75,8 +74,11 @@ foreach my $i (0...37) {
     if ( substr( $lastupdatedtime, 0, 10 ) eq $today->dmy('/') ) {
         $update_info = "Today";
     } elsif ( substr( $lastupdatedtime, 0, 10 ) eq
-              $yesterday->dmy('/') ) {
+              $today->subtract( days => 1 )->dmy('/') ) {
         $update_info = "Yesterday";
+    } elsif ( substr( $lastupdatedtime, 0, 10 ) eq
+              $today->add( days => 1 )->dmy('/') ) {
+        $update_info = "Tomorrow"; # Hopefully we don't see this.
     } else {
         $update_info =
             $months[substr( $lastupdatedtime, 3, 2 )] .