summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-11-22 19:25:50 +0100
committerDaniel Friesel <derf@finalrewind.org>2010-11-22 19:25:50 +0100
commit9813b09127d61d6b11120aff7678d480e44e07f7 (patch)
treeed3f8fdbe8743fe83d3604cd4200a698694f09d8 /bin
parent3610b02449050fdcb1470c469839c5334fe56ae5 (diff)
vzds: Support shifts starting at half hours
Diffstat (limited to 'bin')
-rwxr-xr-xbin/vzds12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/vzds b/bin/vzds
index e494e08..c8f3817 100755
--- a/bin/vzds
+++ b/bin/vzds
@@ -53,7 +53,7 @@ for my $i (1 .. $count) {
next;
}
- if ($cur !~ /^ \d+ $/x) {
+ if ($cur !~ /^ \d+ ( \. \d+)? $/x) {
$im->filledRectangle($x_off + 1, $y_off + 1, $x_off + 39, $y_off +
39, $colour);
$im->string(gdSmallFont, $x_off + 2, $y_off + 2, "${day} ${mday}",
@@ -88,16 +88,18 @@ for my $i (1 .. $count) {
$colour);
$im->string(gdSmallFont, $x_off + 2, $y_off + 2, "${day} ${mday}",
$black);
- $im->string(gdSmallFont, $x_off + 6, $y_off + 20, sprintf('%02d:00',
- $cur), $black);
+ $im->string(gdSmallFont, $x_off + 6, $y_off + 20, sprintf('%02d:%02d',
+ $cur, ($cur - int($cur)) * 60), $black);
$im->rectangle($x_off, $y_off, $x_off + 40, $y_off + 40, $gray);
$text .= sprintf(
- "%s%s %02d:00 -> %02d:00\n",
+ "%s%s %02d:%02d -> %02d:%02d\n",
strftime("%a %b %d", @time),
color('reset'),
- $cur,
+ int($cur),
+ ($cur - int($cur)) * 60,
$cur + 8,
+ ($cur - int($cur)) * 60,
);
}