func SelectedDay() string {
	return common.Days[common.G.SelectedDay]
}
SelectedDay returns selected day view name
package actions
import (
	"fmt"
	"os"
	"github.com/strang1ato/tibivi-gocui"
	"github.com/strang1ato/tibivi/pkg/common"
)
func Quit() error {
	for _, day := range common.Days {
		if common.UpdatedDays[day] {
			common.Views.Bar["bar"].Clear()
			message := "No write since last change (add ! to override)"
			fmt.Fprint(common.Views.Bar["bar"], "\x1b[41m"+message+"\x1b[0m")
			return nil
		}
	}
	return gocui.ErrQuit
}
func QuitIgnore(g *gocui.Gui, v *gocui.View) error {
	return gocui.ErrQuit
}
func Write() error {
	for _, day := range common.Days {
		if common.UpdatedDays[day] {
			datafile, err := os.Create(common.DotTibivi + day + ".txt")
			if err != nil {
				return err
			}
			for _, b := range common.Schedule[day] {
				time := b.StartHour + ":" + b.StartMinute + "-" + b.FinishHour + ":" + b.FinishMinute
				_, err := datafile.WriteString(time + " " + b.Description + "\n")
				if err != nil {
					return err
				}
			}
			common.UpdatedDays[day] = false
		}
	}
	return nil
}
func WriteQuit() error {
	if err := Write(); err != nil {
		return err
	}
	return gocui.ErrQuit
}