func (VS *Server) showCurrentTime(periodtime TimeChanges) gin.HandlerFunc {
	return func(c *gin.Context) {
		var t string
		switch periodtime {

		case current:
			FakeDate = getTime()
			y, m, d := time.Unix(getTime(), 0).Date()
			t = time.Unix(getTime(), 0).Weekday().String() + ", " + strconv.Itoa(d) + " of " + m.String() + " of " + strconv.Itoa(y)

		case reset:
			FakeDate = time.Now().Unix()
			TimeBeforeChanging = time.Now().Unix()
			c.Redirect(http.StatusFound, "/development/show-current-time")

		case dayPlus:
			t := time.Unix(FakeDate, 0)
			t = t.AddDate(0, 0, 1)
			FakeDate = t.Unix()
			TimeBeforeChanging = time.Now().Unix()
			c.Redirect(http.StatusFound, "/development/show-current-time")

		case dayMinus:
			t := time.Unix(FakeDate, 0)
			t = t.AddDate(0, 0, -1)
			FakeDate = t.Unix()
			TimeBeforeChanging = time.Now().Unix()
			c.Redirect(http.StatusFound, "/development/show-current-time")

		case weekPlus:
			t := time.Unix(FakeDate, 0)
			t = t.AddDate(0, 0, 7)
			FakeDate = t.Unix()
			TimeBeforeChanging = time.Now().Unix()
			c.Redirect(http.StatusFound, "/development/show-current-time")

		case weekMinus:
			t := time.Unix(FakeDate, 0)
			t = t.AddDate(0, 0, -7)
			FakeDate = t.Unix()
			TimeBeforeChanging = time.Now().Unix()
			c.Redirect(http.StatusFound, "/development/show-current-time")
		}
		render(c, gin.H{
			"time": t,
		}, "edit-time.html")
	}
}
// This handler changes the time from the developer selection and shows the new time that is set into the app
This handler changes the time from the developer selection and shows the new time that is set into the app
// This handler changes the time from the developer selection and shows the new time that is set into the app
func (VS *Server) showCurrentTime(periodtime TimeChanges) gin.HandlerFunc {
	return func(c *gin.Context) {
		var t string
		switch periodtime {
		case current:
			FakeDate = getTime()
			y, m, d := time.Unix(getTime(), 0).Date()
			t = time.Unix(getTime(), 0).Weekday().String() + ", " + strconv.Itoa(d) + " of " + m.String() + " of " + strconv.Itoa(y)
		case reset:
			FakeDate = time.Now().Unix()
			TimeBeforeChanging = time.Now().Unix()
			c.Redirect(http.StatusFound, "/development/show-current-time")
		case dayPlus:
			t := time.Unix(FakeDate, 0)
			t = t.AddDate(0, 0, 1)
			FakeDate = t.Unix()
			TimeBeforeChanging = time.Now().Unix()
			c.Redirect(http.StatusFound, "/development/show-current-time")
		case dayMinus:
			t := time.Unix(FakeDate, 0)
			t = t.AddDate(0, 0, -1)
			FakeDate = t.Unix()
			TimeBeforeChanging = time.Now().Unix()
			c.Redirect(http.StatusFound, "/development/show-current-time")
		case weekPlus:
			t := time.Unix(FakeDate, 0)
			t = t.AddDate(0, 0, 7)
			FakeDate = t.Unix()
			TimeBeforeChanging = time.Now().Unix()
			c.Redirect(http.StatusFound, "/development/show-current-time")
		case weekMinus:
			t := time.Unix(FakeDate, 0)
			t = t.AddDate(0, 0, -7)
			FakeDate = t.Unix()
			TimeBeforeChanging = time.Now().Unix()
			c.Redirect(http.StatusFound, "/development/show-current-time")
		}
		render(c, gin.H{
			"time": t,
		}, "edit-time.html")
	}
}
func ( VS * Server ) showCurrentTime ( periodtime TimeChanges ) gin . HandlerFunc { return func ( c * gin . Context ) { var t string switch periodtime { case current : FakeDate = getTime ( ) y , m , d := time . Unix ( getTime ( ) , 0 ) . Date ( ) t = time . Unix ( getTime ( ) , 0 ) . Weekday ( ) . String ( ) + " " + strconv . Itoa ( d ) + " " + m . String ( ) + " " + strconv . Itoa ( y ) case reset : FakeDate = time . Now ( ) . Unix ( ) TimeBeforeChanging = time . Now ( ) . Unix ( ) c . Redirect ( http . StatusFound , " " ) case dayPlus : t := time . Unix ( FakeDate , 0 ) t = t . AddDate ( 0 , 0 , 1 ) FakeDate = t . Unix ( ) TimeBeforeChanging = time . Now ( ) . Unix ( ) c . Redirect ( http . StatusFound , " " ) case dayMinus : t := time . Unix ( FakeDate , 0 ) t = t . AddDate ( 0 , 0 , - 1 ) FakeDate = t . Unix ( ) TimeBeforeChanging = time . Now ( ) . Unix ( ) c . Redirect ( http . StatusFound , " " ) case weekPlus : t := time . Unix ( FakeDate , 0 ) t = t . AddDate ( 0 , 0 , 7 ) FakeDate = t . Unix ( ) TimeBeforeChanging = time . Now ( ) . Unix ( ) c . Redirect ( http . StatusFound , " " ) case weekMinus : t := time . Unix ( FakeDate , 0 ) t = t . AddDate ( 0 , 0 , - 7 ) FakeDate = t . Unix ( ) TimeBeforeChanging = time . Now ( ) . Unix ( ) c . Redirect ( http . StatusFound , " " ) } render ( c , gin . H { " " : t , } , " " ) } }
This handler changes the time from the developer selection and shows the new time that is set into the app
This handler changes the time from the developer selection and shows the new time that is set into the app