Browse Source

Allow Sodexo to skip days.

Toni Fadjukoff 12 years ago
parent
commit
d9d548d7a5
1 changed files with 12 additions and 0 deletions
  1. 12 0
      sodexo.pl

+ 12 - 0
sodexo.pl View File

100
 
100
 
101
 sub sodexo_parse_to_food {
101
 sub sodexo_parse_to_food {
102
   my $token = shift;
102
   my $token = shift;
103
+  # Allow list to skip days, ie. Helatorstai
104
+  if ($token->[0] eq 'T') {
105
+    for (my $day = $day_id; $day <= 6; ++$day) {
106
+      if ($token->[1] eq $day_names[$day]) {
107
+        while ($day > $day_id) {
108
+          sodexo_finish_day();
109
+          $day = $day - 1;
110
+        }
111
+        break;
112
+      }
113
+    }
114
+  }
103
   if ($token->[0] eq 'S' && $token->[1] eq "td") {
115
   if ($token->[0] eq 'S' && $token->[1] eq "td") {
104
     my %attrs = %{$token->[2]};
116
     my %attrs = %{$token->[2]};
105
     if ($attrs{'class'} eq "food-type") {
117
     if ($attrs{'class'} eq "food-type") {