mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-01-27 00:33:34 +00:00
29 lines
563 B
Perl
Executable File
29 lines
563 B
Perl
Executable File
#!/usr/bin/perl
|
|
#
|
|
#
|
|
use strict;
|
|
use autodie;
|
|
|
|
my ($dtstart, $rrule, $limit );
|
|
|
|
$limit = 100;
|
|
$dtstart = '19270311T040000Z';
|
|
|
|
while( <> ) {
|
|
m{\s* TZ \s* [:=] \s* (\S+.*) $}xi && do {
|
|
printf( "SET timezone TO '%s';\n", $1);
|
|
};
|
|
m{\s* LIMIT \s* [:=] \s* (\d+) $}xi && do {
|
|
$limit = $1;
|
|
};
|
|
m{\s* DTSTART \s* [:=] \s* (\S+.*) $}ix && do {
|
|
$dtstart = $1;
|
|
};
|
|
m{\s* RRULE \s* [:=] \s* (\S+.*) $}ix && do {
|
|
$rrule = $1;
|
|
printf( "SELECT * FROM event_instances('%s', '%s' ) LIMIT %d;\n", $dtstart, $rrule, $limit);
|
|
$limit = 100;
|
|
};
|
|
}
|
|
|