mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
57_Calender: limit specification when=... amended
git-svn-id: https://svn.fhem.de/fhem/trunk@25010 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9c2e22849e
commit
2bb02ca9a1
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: 57_Calender: limit specification when=... amended
|
||||||
- change: 10_MQTT_BRIDGE: Move to deprecated
|
- change: 10_MQTT_BRIDGE: Move to deprecated
|
||||||
- feature: 98_weekprofile: add userattr 'weekprofile' to supported modules
|
- feature: 98_weekprofile: add userattr 'weekprofile' to supported modules
|
||||||
- change: 98_weekprofile: using id's in module documentation
|
- change: 98_weekprofile: using id's in module documentation
|
||||||
|
@ -2077,16 +2077,24 @@ sub Calendar_Get($@) {
|
|||||||
for my $limit (@limits) {
|
for my $limit (@limits) {
|
||||||
if($limit =~ /count=([1-9]+\d*)/) {
|
if($limit =~ /count=([1-9]+\d*)/) {
|
||||||
$count= $1;
|
$count= $1;
|
||||||
} elsif($limit =~ /when=(today|tomorrow)/i) {
|
} elsif($limit =~ /^when=(today|tomorrow|(-?\d+)(..(-?\d+))?)$/i) {
|
||||||
my ($from,$to);
|
my ($from,$to,$d1,$d2);
|
||||||
if (lc($1) eq 'today') {
|
if (lc($1) eq 'today') {
|
||||||
$from = Calendar_GetSecondsFromMidnight();
|
$d1= 0;
|
||||||
$to = DAYSECONDS - $from - 1;
|
$d2= 0;
|
||||||
$from *= -1;
|
} elsif(lc($1) eq 'tomorrow') {
|
||||||
|
$d1= 1;
|
||||||
|
$d2= 1;
|
||||||
} else {
|
} else {
|
||||||
$from = DAYSECONDS - Calendar_GetSecondsFromMidnight();
|
$d1= $2;
|
||||||
$to = $from + DAYSECONDS - 1;
|
$d2= $d1;
|
||||||
|
if($4 ne '') {
|
||||||
|
$d2= $4;
|
||||||
|
}
|
||||||
|
($d1,$d2)= ($d2,$d1) if($d1> $d2);
|
||||||
}
|
}
|
||||||
|
$from = $d1*DAYSECONDS - Calendar_GetSecondsFromMidnight();
|
||||||
|
$to = $from + ($d2-$d1+1)*DAYSECONDS - 1;
|
||||||
push @filters, { ref => \&filter_endafter, param => $t+$from };
|
push @filters, { ref => \&filter_endafter, param => $t+$from };
|
||||||
push @filters, { ref => \&filter_startbefore, param => $t+$to };
|
push @filters, { ref => \&filter_startbefore, param => $t+$to };
|
||||||
} elsif($limit =~ /from=([+-]?)(.+)/ ) {
|
} elsif($limit =~ /from=([+-]?)(.+)/ ) {
|
||||||
@ -3591,6 +3599,8 @@ sub CalendarEventsAsHtml($;$) {
|
|||||||
a timespan <timespec> from now; use a minus sign for events in the
|
a timespan <timespec> from now; use a minus sign for events in the
|
||||||
past; <timespec> is described below in the Attributes section</td></tr>
|
past; <timespec> is described below in the Attributes section</td></tr>
|
||||||
<tr><td><code>when=today|tomorrow</code></td><td>shows events for today or tomorrow</td></tr>
|
<tr><td><code>when=today|tomorrow</code></td><td>shows events for today or tomorrow</td></tr>
|
||||||
|
<tr><td><code>when=<D1></code></td><td>shows events for day <D1> from now, <D1>= 0 stands for today, negative values allowed </td></tr>
|
||||||
|
<tr><td><code>when=<D1>..<D2></code></td><td>shows events for the day range from day <D1> to day <D2> from now</td></tr>
|
||||||
</table><br>
|
</table><br>
|
||||||
|
|
||||||
Examples:<br>
|
Examples:<br>
|
||||||
@ -4323,6 +4333,9 @@ sub CalendarEventsAsHtml($;$) {
|
|||||||
zeigt nur Termine die vor einer Zeitspanne <timespec> ab jetzt starten;
|
zeigt nur Termine die vor einer Zeitspanne <timespec> ab jetzt starten;
|
||||||
Minuszeichen für Termine in der Vergangenheit benutzen; <timespec> wird weiter unten im Attribut-Abschnitt beschrieben.</td></tr>
|
Minuszeichen für Termine in der Vergangenheit benutzen; <timespec> wird weiter unten im Attribut-Abschnitt beschrieben.</td></tr>
|
||||||
<tr><td><code>when=today|tomorrow</code></td><td>zeigt anstehende Termin für heute oder morgen an</td></tr>
|
<tr><td><code>when=today|tomorrow</code></td><td>zeigt anstehende Termin für heute oder morgen an</td></tr>
|
||||||
|
<tr><td><code>when=<D1></code></td><td>zeigt Termine für Tag <D1> von heute an, <D1>= 0 steht für heute, negative Werte sind erlaubt</td></tr>
|
||||||
|
<tr><td><code>when=<D1>..<D2></code></td><td>zeigt Termine für den Tagesbereich von Tag
|
||||||
|
<D1> bis Tag <D2> von heute an</td></tr>
|
||||||
</table><br>
|
</table><br>
|
||||||
|
|
||||||
Examples:<br>
|
Examples:<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user