fehlerbehebung
This commit is contained in:
parent
de1deec4ad
commit
c337e85a9a
8
func.go
8
func.go
|
@ -9,8 +9,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func logger(input string) {
|
func logger(input string) {
|
||||||
println("[" + time.Now().Format("15:04:05 UTC+1") + "] " + input)
|
println("[" + time.Now().Format("15:04:05 CET") + "] " + input)
|
||||||
fileAddLine("["+time.Now().Format("15:04:05 UTC+1")+"] "+input, "./log/"+time.Now().Format("2006-02-01")+".log")
|
fileAddLine("["+time.Now().Format("15:04:05 CET")+"] "+input, "./log/"+time.Now().Format("2006-02-01 CET")+".log")
|
||||||
}
|
}
|
||||||
|
|
||||||
func handler() {
|
func handler() {
|
||||||
|
@ -212,7 +212,7 @@ func getNextTopic() topic {
|
||||||
var output topic
|
var output topic
|
||||||
|
|
||||||
for i := 0; i < 31; i++ {
|
for i := 0; i < 31; i++ {
|
||||||
newDate := stringSplit(date.AddDate(0, 0, 1*i).Format(time.UnixDate), " ")
|
newDate := stringSplit(date.AddDate(0, 0, 1*i).Format("Mon Jan _2 15:04:05 CET 2006"), " ")
|
||||||
|
|
||||||
if newDate[0] == "Thu" || newDate[0] == "Tue" {
|
if newDate[0] == "Thu" || newDate[0] == "Tue" {
|
||||||
dayA, errA := strconv.Atoi(newDate[2])
|
dayA, errA := strconv.Atoi(newDate[2])
|
||||||
|
@ -222,7 +222,7 @@ func getNextTopic() topic {
|
||||||
errorPanic(errB)
|
errorPanic(errB)
|
||||||
|
|
||||||
if ifFloatRange(float64(dayA)/7, 0, 1, false, true) || (ifFloatRange(float64(dayB)/7, 2, 3, false, true) && newDate[0] == "Tue") {
|
if ifFloatRange(float64(dayA)/7, 0, 1, false, true) || (ifFloatRange(float64(dayB)/7, 2, 3, false, true) && newDate[0] == "Tue") {
|
||||||
output.date = date.AddDate(0, 0, 1*i).Format("02.01.2006")
|
output.date = date.AddDate(0, 0, 1*i).Format("02.01.2006 CET")
|
||||||
output.days = i
|
output.days = i
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
4
http.go
4
http.go
|
@ -6,7 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func httpHandleFunc(urlPath string, filepath string, contentType string) {
|
func httpHandleFunc(urlPath string, filepath string, contentType string) {
|
||||||
logger("--> " + readHttpYML() + "/" + urlPath + " " + filepath + " " + contentType)
|
logger(readHttpYML() + "/" + urlPath + " - " + filepath + " " + contentType)
|
||||||
http.HandleFunc("/"+urlPath, func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/"+urlPath, func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Add("Content-Type", contentType)
|
w.Header().Add("Content-Type", contentType)
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ func httpHandleFunc(urlPath string, filepath string, contentType string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string) {
|
func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string) {
|
||||||
logger("--> " + readHttpYML() + "/" + urlPath + " " + filepath + " " + contentType)
|
logger(readHttpYML() + "/" + urlPath + " - " + filepath + " " + contentType)
|
||||||
s := new(submit)
|
s := new(submit)
|
||||||
s.data = "null"
|
s.data = "null"
|
||||||
http.HandleFunc("/"+urlPath, func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/"+urlPath, func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
Loading…
Reference in New Issue