https://github.com/grsmv/date-range-format
Formatting date ranges in Go with i18n support
https://github.com/grsmv/date-range-format
date date-range go golang
Last synced: 11 months ago
JSON representation
Formatting date ranges in Go with i18n support
- Host: GitHub
- URL: https://github.com/grsmv/date-range-format
- Owner: grsmv
- License: mit
- Created: 2017-03-20T13:55:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-25T14:11:18.000Z (over 8 years ago)
- Last Synced: 2025-01-10T18:21:07.546Z (about 1 year ago)
- Topics: date, date-range, go, golang
- Language: Go
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE.md
Awesome Lists containing this project
README
date-range-format
-----------------
Formatting date ranges in Go with i18n support (currently for Ukrainian, English and Russian languages).
Usage:
import format "github.com/grsmv/date-range-format"
format.DateRangeFormat(
"uk",
time.Date(2017, 1, 1, 0, 0, 0, 0, time.Local),
time.Date(2017, 1, 5, 0, 0, 0, 0, time.Local),
) // will give `1 - 5 січня 2017`
format.DateRangeFormat(
"en",
time.Date(2017, 1, 30, 0, 0, 0, 0, time.Local),
time.Date(2017, 2, 7, 0, 0, 0, 0, time.Local),
) // will give `January, 30 - February, 7 2017`
Enjoy!