period

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *defaultTool

Types

type Client

type Client interface {
	FirstPeriodStartDate(year int) time.Time
	LastDayOfLastPeriod(year int) time.Time
	FirstDayOfMonth(date time.Time) time.Time
	PeriodNumber(date time.Time) int
	TimeOfWeekday(date time.Time, weekday time.Weekday) time.Time
}

func NewClient

func NewClient(opts PeriodOptions) Client

type PeriodOption

type PeriodOption func(*PeriodOptions)

func WithOffset

func WithOffset(offset int) PeriodOption

type PeriodOptions

type PeriodOptions struct {
	Offset int
}

func ApplyPeriodOptions

func ApplyPeriodOptions(opts *PeriodOptions, modifiers ...PeriodOption) PeriodOptions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL