Emailing management, administration improvement, Carpooling in multimodal search

This commit is contained in:
2022-10-17 05:02:19 +02:00
parent 23f4603dec
commit c2c6a72f81
82 changed files with 1778 additions and 163 deletions

View File

@@ -5,6 +5,8 @@ import (
"fmt"
"html/template"
"time"
"gitlab.scity.coop/maas/navitia-golang/types"
)
func TimeFrom(d any) *time.Time {
@@ -68,6 +70,16 @@ func Dict(v ...interface{}) map[string]interface{} {
return dict
}
func WalkingLength(s types.Section) (l int) {
l = 0
if s.Mode == "walking" {
for _, p := range s.Path {
l = l + int(p.Length)
}
}
return
}
func strval(v interface{}) string {
switch v := v.(type) {
case string:
@@ -82,3 +94,7 @@ func strval(v interface{}) string {
return fmt.Sprintf("%v", v)
}
}
func Divide[V int | float64](a, b V) V {
return a / b
}