dateformatter

package module
v0.0.0-...-7f51bee Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: MIT Imports: 4 Imported by: 1

README

dateformatter

DEPRECATED: Use https://github.com/altipla-consulting/libs instead.

Basic date formatter with strings extracted from CLDR

Install

go get github.com/altipla-consulting/dateformatter

Documentation

GoDoc

Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using gofmt.

License

New code is under the MIT License. Large parts of the format code are extracted from the Go standard library under a BSD License.

Documentation

Overview

Package dateformatter helps formatting date in the correct locale. It uses data extracted from CLDR v27.0.1.

It has the same formatting options as the time package of the standard library, excluding timezones and nanoseconds as they are not needed in a daily basis to format user-facing dates and times.

It has support for the following langs: spanish, english, french and russian. More can be added on demand modifying the generator to create the symbols files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

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

Format returns a textual representation of the time value formatted according to layout, which defines the format by showing how the reference time, defined to be

Mon Jan 2 15:04:05 2006

would be displayed if it were the value; it serves as an example of the desired output. The same display rules will then be applied to the time value.

Predefined layouts ANSIC, UnixDate, RFC3339 and others describe standard and convenient representations of the reference time. For more information about the formats and the definition of the reference time, see the documentation for ANSIC and the other constants defined by this package.

Types

This section is empty.

Directories

Path Synopsis
Package generator helps with creating the symbols files for supported langs extracting the data from CLDR.
Package generator helps with creating the symbols files for supported langs extracting the data from CLDR.
Package symbols contains the autogenerated i18n symbols for formatting.
Package symbols contains the autogenerated i18n symbols for formatting.

Jump to

Keyboard shortcuts

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