Documentation ¶
Index ¶
- Constants
- func CheckIfError(err error)
- func IsSameDay(t1 time.Time, t2 time.Time) bool
- func NewWorkDayModelSlice(records []WorkDayRecord) *[]WorkDayModel
- func RoundDown(t time.Time) time.Time
- func RoundUp(t time.Time) time.Time
- func SetMainMenu(metadata fyne.AppMetadata, w fyne.Window) *fyne.MainMenu
- func UpdateTime(baseTime time.Time, s string) (time.Time, error)
- type BreakTimeEditor
- func (e *BreakTimeEditor) Add(startTime string, endTime string) error
- func (e *BreakTimeEditor) Delete(index int)
- func (e *BreakTimeEditor) Edit(index int, newStartTime string, newEndTime string) error
- func (e *BreakTimeEditor) GetEnd(index int) string
- func (e *BreakTimeEditor) GetPauseTime(index int) string
- func (e *BreakTimeEditor) GetPauses() []WorkPause
- func (e *BreakTimeEditor) GetStart(index int) string
- type EditBreakTimeView
- type FileHandler
- type MainWindowView
- type PunchClock
- type PunchclockController
- type PunchclockModel
- type RecordStorage
- type Selected
- type TappableLabel
- type TimesheetModel
- func (ts *TimesheetModel) GetAllRecords() []WorkDayRecord
- func (ts *TimesheetModel) GetCurrentMonth() (selected []WorkDayRecord)
- func (ts *TimesheetModel) GetIndexOf(day WorkDayRecord) int
- func (ts *TimesheetModel) GetPreviousMonths() (selected []WorkDayRecord)
- func (ts *TimesheetModel) GetToday() WorkDay
- func (ts *TimesheetModel) SortRecords()
- func (ts *TimesheetModel) UpdateWorkDay(updated WorkDayRecord)
- type ValidatedTimeEntry
- type WorkDay
- type WorkDayModel
- func (m *WorkDayModel) Day() string
- func (m *WorkDayModel) End() string
- func (m *WorkDayModel) Pause() string
- func (m *WorkDayModel) SetEnd(timeStr string) error
- func (m *WorkDayModel) SetPauses(pauses []WorkPause)
- func (m *WorkDayModel) SetStart(timeStr string) error
- func (m *WorkDayModel) Start() string
- func (m *WorkDayModel) WorkingTime() string
- type WorkDayRecord
- type WorkPause
Constants ¶
View Source
const ( WORKING string = "Working" PAUSED string = "Paused" )
View Source
const ( YYYYMMDD = "2006-01-02" HHMMSS24h = "15:04" )
View Source
const (
COLUMNS = 5
)
Variables ¶
This section is empty.
Functions ¶
func CheckIfError ¶
func CheckIfError(err error)
func NewWorkDayModelSlice ¶
func NewWorkDayModelSlice(records []WorkDayRecord) *[]WorkDayModel
func SetMainMenu ¶
func SetMainMenu(metadata fyne.AppMetadata, w fyne.Window) *fyne.MainMenu
Types ¶
type BreakTimeEditor ¶
type BreakTimeEditor struct {
// contains filtered or unexported fields
}
func NewBreakTimeEditor ¶
func NewBreakTimeEditor(w *WorkDay) *BreakTimeEditor
func (*BreakTimeEditor) Delete ¶
func (e *BreakTimeEditor) Delete(index int)
func (*BreakTimeEditor) Edit ¶
func (e *BreakTimeEditor) Edit(index int, newStartTime string, newEndTime string) error
func (*BreakTimeEditor) GetEnd ¶
func (e *BreakTimeEditor) GetEnd(index int) string
func (*BreakTimeEditor) GetPauseTime ¶
func (e *BreakTimeEditor) GetPauseTime(index int) string
func (*BreakTimeEditor) GetPauses ¶
func (e *BreakTimeEditor) GetPauses() []WorkPause
func (*BreakTimeEditor) GetStart ¶
func (e *BreakTimeEditor) GetStart(index int) string
type EditBreakTimeView ¶
type EditBreakTimeView struct { Pauses []WorkPause OnSubmitted func() // contains filtered or unexported fields }
func (*EditBreakTimeView) Show ¶
func (v *EditBreakTimeView) Show(parent *fyne.Window, day WorkDay)
type FileHandler ¶
type FileHandler struct {
// contains filtered or unexported fields
}
func NewFileHandler ¶
func NewFileHandler(filepath string) *FileHandler
func (*FileHandler) Load ¶
func (fh *FileHandler) Load() ([]WorkDayRecord, error)
func (*FileHandler) Save ¶
func (fh *FileHandler) Save(records []WorkDayRecord) error
type MainWindowView ¶
type MainWindowView struct {
// contains filtered or unexported fields
}
func NewMainWindowView ¶
func NewMainWindowView(c *PunchclockController, m *PunchclockModel) *MainWindowView
func (*MainWindowView) ShowMainWindow ¶
func (v *MainWindowView) ShowMainWindow()
type PunchClock ¶
type PunchClock struct {
// contains filtered or unexported fields
}
func NewPunchClock ¶
func NewPunchClock() *PunchClock
func NewPunchClockFromData ¶
func NewPunchClockFromData(today WorkDay) *PunchClock
func (*PunchClock) GetCurrentWorkDay ¶
func (pc *PunchClock) GetCurrentWorkDay() WorkDay
func (*PunchClock) GetPreviousWorkDay ¶
func (pc *PunchClock) GetPreviousWorkDay() WorkDay
func (*PunchClock) Pause ¶
func (pc *PunchClock) Pause()
func (*PunchClock) SetCurrentWorkDay ¶
func (pc *PunchClock) SetCurrentWorkDay(wd WorkDay)
func (*PunchClock) Work ¶
func (pc *PunchClock) Work()
type PunchclockController ¶
type PunchclockController struct { Model *PunchclockModel Status string // contains filtered or unexported fields }
func NewPunchclockController ¶
func NewPunchclockController(storage RecordStorage) *PunchclockController
func (*PunchclockController) Pause ¶
func (c *PunchclockController) Pause()
func (*PunchclockController) Present ¶
func (c *PunchclockController) Present()
func (*PunchclockController) Refresh ¶
func (c *PunchclockController) Refresh()
func (*PunchclockController) ToggleSelectedMonth ¶
func (c *PunchclockController) ToggleSelectedMonth() string
func (*PunchclockController) Update ¶
func (c *PunchclockController) Update(day WorkDayRecord)
type PunchclockModel ¶
type PunchclockModel struct {
SelectedMonth []WorkDayModel
}
type RecordStorage ¶
type RecordStorage interface { Save(records []WorkDayRecord) error Load() ([]WorkDayRecord, error) }
type TappableLabel ¶
func NewTappableLabel ¶
func NewTappableLabel(text string, tapped func()) *TappableLabel
func (*TappableLabel) Tapped ¶
func (t *TappableLabel) Tapped(*fyne.PointEvent)
func (*TappableLabel) TappedSecondary ¶
func (t *TappableLabel) TappedSecondary(*fyne.PointEvent)
type TimesheetModel ¶
type TimesheetModel struct {
// contains filtered or unexported fields
}
func NewTimesheetModel ¶
func NewTimesheetModel(records []WorkDayRecord) *TimesheetModel
func (*TimesheetModel) GetAllRecords ¶
func (ts *TimesheetModel) GetAllRecords() []WorkDayRecord
func (*TimesheetModel) GetCurrentMonth ¶
func (ts *TimesheetModel) GetCurrentMonth() (selected []WorkDayRecord)
func (*TimesheetModel) GetIndexOf ¶
func (ts *TimesheetModel) GetIndexOf(day WorkDayRecord) int
func (*TimesheetModel) GetPreviousMonths ¶
func (ts *TimesheetModel) GetPreviousMonths() (selected []WorkDayRecord)
func (*TimesheetModel) GetToday ¶
func (ts *TimesheetModel) GetToday() WorkDay
func (*TimesheetModel) SortRecords ¶
func (ts *TimesheetModel) SortRecords()
func (*TimesheetModel) UpdateWorkDay ¶
func (ts *TimesheetModel) UpdateWorkDay(updated WorkDayRecord)
type ValidatedTimeEntry ¶
func NewValidatedTimeEntry ¶
func NewValidatedTimeEntry() *ValidatedTimeEntry
func (*ValidatedTimeEntry) Clear ¶
func (e *ValidatedTimeEntry) Clear()
type WorkDay ¶
type WorkDay struct { WorkStarted time.Time `json:"WorkStarted"` WorkEnded time.Time `json:"WorkEnded"` Pauses []WorkPause `json:"Pauses"` }
func NewWorkDay ¶
type WorkDayModel ¶
type WorkDayModel struct {
// contains filtered or unexported fields
}
func NewWorkDayModel ¶
func NewWorkDayModel(record WorkDayRecord) WorkDayModel
func (*WorkDayModel) Day ¶
func (m *WorkDayModel) Day() string
func (*WorkDayModel) End ¶
func (m *WorkDayModel) End() string
func (*WorkDayModel) Pause ¶
func (m *WorkDayModel) Pause() string
func (*WorkDayModel) SetEnd ¶
func (m *WorkDayModel) SetEnd(timeStr string) error
func (*WorkDayModel) SetPauses ¶
func (m *WorkDayModel) SetPauses(pauses []WorkPause)
func (*WorkDayModel) SetStart ¶
func (m *WorkDayModel) SetStart(timeStr string) error
func (*WorkDayModel) Start ¶
func (m *WorkDayModel) Start() string
func (*WorkDayModel) WorkingTime ¶
func (m *WorkDayModel) WorkingTime() string
type WorkDayRecord ¶
type WorkDayRecord struct { WorkDay WorkDay `json:"WorkDay"` WorkingTime time.Duration `json:"WorkingTime"` PauseTime time.Duration `json:"PauseTime"` }
func CalculateWorkDay ¶
func CalculateWorkDay(workday WorkDay) WorkDayRecord
Click to show internal directories.
Click to hide internal directories.