yymmdd

package
v0.0.0-...-8bdd4ce Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYearMark  string = "T_YEAR_MARK"
	TMonthMark string = "T_MONTH_MARK"
	TDayMark   string = "T_DAY_MARK"
	TRawMark   string = "T_RAW_MARK"
	TEof       string = "T_EOF"
)

Variables

View Source
var EOF string = "+++EOF+++"

EOF character

View Source
var InvalidTimeFormat = errors.New("invalid time format")

Functions

func Format

func Format(time time.Time, layout string) string

Types

type DayFormatter

type DayFormatter struct {
	// contains filtered or unexported fields
}

func (*DayFormatter) String

func (self *DayFormatter) String() string

type Formatter

type Formatter struct {
	Items []ItemFormatter
}

func Parse

func Parse(tokens []LexToken) Formatter

Parse creates a new parser with the recommended parameters.

func (*Formatter) Format

func (f *Formatter) Format(t time.Time) string

type ItemFormatter

type ItemFormatter interface {
	// contains filtered or unexported methods
}

type LexToken

type LexToken [3]string

LexToken holds is a (type, value) array.

func Lexer

func Lexer(input string) (*lexer, []LexToken)

Lexer creates a new scanner for the input string.

type MonthFormatter

type MonthFormatter struct {
	// contains filtered or unexported fields
}

func (*MonthFormatter) String

func (self *MonthFormatter) String() string

type YearFormatter

type YearFormatter struct {
	// contains filtered or unexported fields
}

func (*YearFormatter) String

func (y *YearFormatter) String() string

Jump to

Keyboard shortcuts

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