more development
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"math"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -11,4 +15,20 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatalf("[ERROR] Unable to calculate sunrise/sunset: %v\n", err)
|
||||
}
|
||||
|
||||
if config.NextSunrise || config.NextSunset {
|
||||
sR, sS, err := nextSunriseSunsetTime(config.SunRiseSet.Date)
|
||||
if err != nil {
|
||||
runError(fmt.Sprintf("Unable to calculate sunrise/sunset: %v\n", err))
|
||||
}
|
||||
|
||||
switch {
|
||||
case config.NextSunrise:
|
||||
fmt.Printf("%v\n", math.Round(sR.Sub(time.Now()).Seconds()))
|
||||
case config.NextSunset:
|
||||
fmt.Printf("%v\n", math.Round(sS.Sub(time.Now()).Seconds()))
|
||||
}
|
||||
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user