package
0.0.0-20250225133122-0516d5b855ff
Repository: https://github.com/domonda/go-types.git
Documentation: pkg.go.dev
# Functions
No description provided by the author
Must returns str as normalized Date or panics if str is not a valid Date.
MustNullable returns str as normalized NullableDate or panics if str is not neither a valid Date nor Null ("").
No description provided by the author
Normalize returns str as normalized Date or an error.
NormalizeNullable returns str as normalized NullableDate or an error.
Of returns a normalized Date for the given year, month, and day.
OfNowInUTC returns the date of the current time in the UTC timezone.
OfTime returns the date part of the passed time.Time or an empty string if t.IsZero().
OfTimePtr returns the date part of the passed time.Time or Null (an empty string) if t is nil or t.IsZero().
OfToday returns the date of today in the local timezone.
OfTodayUTC returns the date of today in the timezone of the passed location.
OfTomorrow returns the date of tomorrow in the local timezone.
OfYesterday returns the date of yesterday in the local timezone.
Parse returns the date part from time.Parse(layout, value).
ParseTime is a non Date related helper function that parses the passed string as time.Time.
PeriodRange returns the dates [from, until] for a period defined in one the following formats: period of a ISO 8601 week of a year: YYYY-Wnn period of a month of a year: YYYY-MM, period of a quarter of a year: YYYY-Qn, period of a half year: YYYY-Hn, period of full year: YYYY.
StringIsDate returns if a string can be parsed as Date.
YearRange returns the date range from first of January to 31st of December of a year.
YearWeekMonday returns the date of Monday of an ISO 8601 week.
YearWeekRange returns the dates of Monday and Sunday of an ISO 8601 week.
# Variables
Null is an empty string and will be treatet as SQL NULL.
No description provided by the author
# Type aliases
Date represents a the day of calender date Date implements the database/sql.Scanner and database/sql/driver.Valuer interfaces, and will treat an empty string or the zero dates "0000-00-00" and "0001-01-01" (see IsZero) as SQL NULL.
No description provided by the author
NullableDate is identical to Date, except that IsZero() is considered valid by the Valid() and Validate() methods.