Sprechstunden löschen und Raumbeschränkungen beachten
This commit is contained in:
parent
2ce7a1fae1
commit
56b4a3ab34
7 changed files with 88 additions and 10 deletions
|
@ -26,3 +26,34 @@ func DayName(day int) string {
|
|||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
func DateLess(first Date, second Date) bool {
|
||||
if first.Day < second.Day {
|
||||
return true
|
||||
} else if first.Day > second.Day {
|
||||
return false
|
||||
}
|
||||
if first.Hour < second.Hour {
|
||||
return true
|
||||
} else if first.Hour > second.Hour {
|
||||
return false
|
||||
}
|
||||
if first.Minute < second.Minute {
|
||||
return true
|
||||
} else if first.Minute > second.Minute {
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func GetEndDate(date Date, duration int, ignoreWeek bool) Date {
|
||||
var endDate Date
|
||||
if ignoreWeek {
|
||||
endDate = Date{0, date.Day, date.Hour, date.Minute} // deep copy
|
||||
} else {
|
||||
endDate = Date{date.Week, date.Day, date.Hour, date.Minute}
|
||||
}
|
||||
endDate.Hour = endDate.Hour + (endDate.Minute+duration)/60
|
||||
endDate.Minute = (endDate.Minute + duration) % 60
|
||||
return endDate
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue