Documentation
¶
Overview ¶
Package strftime formats lys-shell's strftime-style format strings. The clock and other time-bearing modules take user formats in strftime syntax; Go layouts are never user-facing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var English = Names{ Weekdays: [7]string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}, ShortWeekdays: [7]string{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}, Months: [12]string{"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}, ShortMonths: [12]string{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}, }
English is the C locale's names.
Functions ¶
This section is empty.
Types ¶
type Layout ¶
type Layout struct {
// contains filtered or unexported fields
}
Layout is a compiled strftime format: validated once at load, then formatted per tick without re-parsing.
func Compile ¶
Compile validates a strftime format. Unsupported or dangling specifiers are errors — a bad format fails at load instead of rendering garbage at runtime.
func (*Layout) FormatIn ¶
FormatIn renders t through the compiled format with the given names. Literal text passes through unchanged; "%%" renders a single percent sign. A chrono padding flag between the percent and the specifier re-pads numeric fields: "-" drops the padding (%-d is "5"), "_" pads with spaces, "0" with zeros; on text fields the flag changes nothing, as in chrono.
func (*Layout) Resolution ¶
Resolution is how often the rendered text can change: a second with a seconds field in the format, otherwise a minute.