utils

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

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

Go to latest
Published: Jan 20, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PriorityHigh   = 1
	PriorityMedium = 2
	PriorityLow    = 3
	PriorityNone   = 4
)

Constants for wrapping text and priority values.

Variables

This section is empty.

Functions

func ColoredPastDue

func ColoredPastDue(dueDate *time.Time, completed bool) string

ColoredPastDue returns a colored string depending on the due date.

func FormatDate

func FormatDate(t *time.Time) string

FormatDate formats a time.Time object into a human-readable string in the format "YYYY-MM-DD HH:MM".

func GetPriorityString

func GetPriorityString(priority int) string

GetPriorityString returns the string representation of a Priority value.

func ParseDueDate

func ParseDueDate(dueDateStr string) (*time.Time, error)

ParseDueDate parses a date string in the format "2006-01-02 15:04" and returns a pointer to time.Time.

func ParseIntOrError

func ParseIntOrError(value string) (int, error)

ParseIntOrError tries to parse a string as an integer and returns an error if the parsing fails.

func WrapText

func WrapText(text string, maxLength int) string

WrapText wraps a given text to a specified maximum line length.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳