mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
# File for giving sunset info
|
|
#
|
|
# This file is part of REMIND.
|
|
# Copyright (C) 1992-2026 by Dianne Skoll
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
set now now()
|
|
|
|
banner %
|
|
|
|
MSG <HEAD>%
|
|
MSG <TITLE>Sunset in [$Location]</TITLE>%
|
|
MSG <LINK rel="stylesheet" href="%IMAGEBASE%/calendar.css">%
|
|
MSG </HEAD>%
|
|
|
|
MSG <BODY>
|
|
MSG <H1>Sunset in [$Location]</H1>
|
|
|
|
set tod sunset(today())
|
|
set tom sunset(today()+1)
|
|
|
|
set len1 sunset(today())-sunrise(today())
|
|
set len2 sunset(today()+1)-sunrise(today()+1)
|
|
set dlen len2-len1
|
|
set slen iif(dlen==0, "the same length as", dlen<0, abs(dlen)+plural(abs(dlen)," minute", " minutes")+" shorter than", dlen+plural(dlen, " minute", " minutes")+" longer than")
|
|
|
|
set diff tod-now
|
|
set adiff abs(diff)
|
|
set hdiff adiff/60
|
|
set mdiff adiff%60
|
|
|
|
set mstr iif(mdiff==0, "", mdiff == 1, "1 minute", mdiff + " minutes")
|
|
set hstr iif(hdiff==0, "", hdiff == 1, "1 hour", hdiff + " hours")
|
|
set astr iif(mdiff!=0 && hdiff!=0, " and ", "")
|
|
set fn iif(diff==0, "now", diff <0, "ago", "from now")
|
|
set iw iif(diff<0, "was", "is")
|
|
set aw iif(tod==tom, " as well.", ".")
|
|
msg Today is %w, %d %m, %y.<P>
|
|
msg The local time in [$Location] is [now].<P>
|
|
msg Sunset today [iw] at [tod]; in other words, [hstr][astr][mstr] [fn].<P>
|
|
msg Sunset tomorrow is at [tom][aw]<P>
|
|
msg The daylight portion of tomorrow will be [slen] today.<P>
|
|
msg </BODY>
|