daishisystems / month

Package month provides functionality pertaining to months of the year, encapsulating some of the more verbose features of underlying Go packages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image of insidethecpu

Go Month Package

Join the chat at https://gitter.im/daishisystems/month Build Status godoc

Package month provides functionality pertaining to months of the year. The package is designed with developer productivity in mind, encapsulating some of the more verbose features of underlying Go packages, and exposing them intuitively. Examples of this include the ability to return the last day of any given month.

Month Icon

Installation

go get github.com/daishisystems/month

Sample Code

	// The last numeric day of January is 31
	m := month.January
	fmt.Printf("The last numeric day of %s is %d\n", m, m.LastDay(2015))

	// The last numeric day of February is 28
	m = month.February
	fmt.Printf("The last numeric day of %s is %d\n", m, month.February.LastDay(2015))

	// The last numeric day of February is 29
	m = month.February
	fmt.Printf("The last numeric day of %s is %d\n", m, m.LastDay(2008))

	// The last numeric day of July is 31
	m = month.July
	fmt.Printf("The last numeric day of %s is %d\n", m, m.LastDay(2015))

Contact the Developer

Please reach out and contact me for questions, suggestions, or to just talk tech in general.

RSSTwitterLinkedInGoogle+YouTube

About

Package month provides functionality pertaining to months of the year, encapsulating some of the more verbose features of underlying Go packages

License:MIT License


Languages

Language:Go 100.0%