示例#1
0
文件: imp.go 项目: CaptainSoOmA/Uni
func (x *Imp) monday (d *day.Imp, n uint) {
//
  w:= x.numWeeks ()
  if n == 0 || n > w {
    d.Clr()
    return
  }
  x.lectures (d, tmp)
  for i:= uint(0); i + 1 < n; i++ {
    d.Inc (day.Weekly)
  }
  if ! x.summer () && n > 10 { // Akademische Ferien
    d.Inc (day.Weekly)
    d.Inc (day.Weekly)
  }
}
示例#2
0
文件: imp.go 项目: CaptainSoOmA/Uni
func (x *Imp) semester (b, e *day.Imp) {
//
  y:= x.Year () % 100
  tmp.Set (1, 4, y)
  if x.Imp.Less (tmp) {
    b.Set (1, 10, y); b.Dec (day.Yearly)
    e.Set (1,  4, y)
  } else {
    tmp.Set (1, 10, y)
    if x.Imp.Less (tmp) {
      b.Set (1,  4, y)
      e.Set (1, 10, y)
    } else {
      b.Set (1, 10, y)
      e.Set (1,  4, y); e.Inc (day.Yearly)
    }
  }
  e.Dec (day.Daily)
}
示例#3
0
文件: imp.go 项目: CaptainSoOmA/Uni
func (x *Imp) lectures (b, e *day.Imp) {
//
  x.semester (b, e)
  y:= x.Year () % 100
  w:= uint(14)
  if x.summer () {
    b.Set (14, 4, y)
  } else {
    b.Set (18, 10, y)
    w += 2 + 2 // Weihnachtsferien
  }
  for ! b.IsBeginning (day.Weekly) {
    b.Dec (day.Daily)
  }
  e.Copy (b)
  for i:= uint(0); i < w; i++ {
    e.Inc (day.Weekly)
  }
  e.Dec (day.Daily)
  e.Dec (day.Daily) // Saturday
}