Documentation
¶
Index ¶
- type Client
- type ClientOption
- type ClientOptions
- type DefaultTool
- func (d *DefaultTool) FirstDayOfMonth(ctx context.Context, date time.Time) (time.Time, error)
- func (d *DefaultTool) FirstPeriodStartDate(ctx context.Context, year int) (time.Time, error)
- func (d *DefaultTool) LastDayOfLastPeriod(ctx context.Context, year int) (time.Time, error)
- func (d *DefaultTool) PeriodNumber(ctx context.Context, date time.Time) (int, error)
- func (d *DefaultTool) TimeOfWeekday(ctx context.Context, date time.Time, weekday time.Weekday) (time.Time, error)
- type Tool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
contract.PeriodOperator
}
func NewClient ¶
func NewClient(opts ClientOptions) Client
type ClientOption ¶ added in v0.1.6
type ClientOption func(*ClientOptions)
func WithOffset ¶
func WithOffset(x int) ClientOption
type ClientOptions ¶ added in v0.1.6
type ClientOptions struct {
Offset int
}
func ApplyClientOptions ¶ added in v0.1.6
func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions
type DefaultTool ¶ added in v0.1.11
func NewTool ¶
func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool
func (*DefaultTool) FirstDayOfMonth ¶ added in v0.1.11
FirstDayOfMonth retrieves the first day of the month for the given date.
func (*DefaultTool) FirstPeriodStartDate ¶ added in v0.1.11
FirstPeriodStartDate retrieves the date of the first day of the first period of the given year.
func (*DefaultTool) LastDayOfLastPeriod ¶ added in v0.1.11
LastDayOfLastPeriod retrieves the last day of the last period of the given year.
func (*DefaultTool) PeriodNumber ¶ added in v0.1.11
PeriodNumber retrieves the period week number for the given date.
Click to show internal directories.
Click to hide internal directories.