tmc

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 6 Imported by: 0

README

tmc

time calculator

Installation

go install github.com/winebarrel/tmc/cmd/tmc@latest

Usage

$ tmc
> 10:10 - 20 + 1:15
11:05
> 10 + 11:20
11:30
> 1:00 - 30
0:30
> 12:00 - 9:15
2:45

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurToStr

func DurToStr(dur time.Duration) string

func Eval

func Eval(str string) (time.Duration, error)

Types

type Expr

type Expr struct {
	Val     Val      `@Time`
	OpeVals []OpeVal `@@*`
}

func (*Expr) Eval

func (expr *Expr) Eval() time.Duration

type OpeVal

type OpeVal struct {
	Ope string `SP* @Ope`
	Val Val    `SP* @Time`
}

type Val

type Val time.Duration

func (*Val) Capture

func (v *Val) Capture(values []string) error

func (Val) Duration

func (v Val) Duration() time.Duration

Directories

Path Synopsis
cmd
tmc

Jump to

Keyboard shortcuts

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