dateparse

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultParser

type DefaultParser struct {
	NowDate func() time.Time // NowDate is a function that returns the current date as time.Time
}

DefaultParser implements the Parser interface.

func New added in v0.2.1

func New() *DefaultParser

func (*DefaultParser) Parse

func (p *DefaultParser) Parse(args []string) (ParseResult, error)

Parse parses command-line arguments to extract username and date.

type ParseResult added in v0.3.3

type ParseResult struct {
	Date     time.Time
	IsWeek   bool
	WeekDays []time.Time
}

ParseResult contains the result of parsing date arguments

type Parser

type Parser interface {
	Parse(args []string) (string, time.Time, error)
}

Parser defines the interface for parsing dates.

Jump to

Keyboard shortcuts

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