period

package
v0.1.78 Latest Latest
Warning

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

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

Documentation

Index

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

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

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

func (*DefaultTool) FirstDayOfMonth added in v0.1.11

func (d *DefaultTool) FirstDayOfMonth(ctx context.Context, date time.Time) (time.Time, error)

FirstDayOfMonth retrieves the first day of the month for the given date.

func (*DefaultTool) FirstPeriodStartDate added in v0.1.11

func (d *DefaultTool) FirstPeriodStartDate(ctx context.Context, year int) (time.Time, error)

FirstPeriodStartDate retrieves the date of the first day of the first period of the given year.

func (*DefaultTool) LastDayOfLastPeriod added in v0.1.11

func (d *DefaultTool) LastDayOfLastPeriod(ctx context.Context, year int) (time.Time, error)

LastDayOfLastPeriod retrieves the last day of the last period of the given year.

func (*DefaultTool) PeriodNumber added in v0.1.11

func (d *DefaultTool) PeriodNumber(ctx context.Context, date time.Time) (int, error)

PeriodNumber retrieves the period week number for the given date.

func (*DefaultTool) TimeOfWeekday added in v0.1.11

func (d *DefaultTool) TimeOfWeekday(ctx context.Context, date time.Time, weekday time.Weekday) (time.Time, error)

TimeOfWeekday retrieves the date of the specified weekday within the same week as the given date.

Jump to

Keyboard shortcuts

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