pdr

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: ISC Imports: 7 Imported by: 0

Documentation

Overview

Package pdr parses date range as string Uses pointlander/peg

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRange

func ParseRange(s string, baseTime time.Time) (start, end time.Time, err error)

ParseRange parses a human readable specified time range into two dates containing that range. start is included in the range, end is just beyond the range. So the returned dates/times are such that the range is start <= RANGE < end.

Also, ranges with a numeric factor are returned as if the current date is a part of the range specified. For instance, the "last two months" is the previous month and the current month. However, range without numeric factor excludes current month. Specifying "last month" returns just the range for that month.

func Pretty

func Pretty(pretty bool) func(*parser) error

func Size

func Size(size int) func(*parser) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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