helpers

package
v0.0.0-...-322571f Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: EUPL-1.2 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dict

func Dict(v ...interface{}) (map[string]interface{}, error)

Dict creates a new map from the given parameters by treating values as key-value pairs. The number of values must be even. See https://github.com/Masterminds/sprig/blob/master/dict.go and https://github.com/gohugoio/hugo/blob/master/tpl/collections/collections.go

func FormatDate

func FormatDate(t *time.Time) string

FormatDate formats the specified time in the Dutch time zone and language

func FormatObservationValue

func FormatObservationValue(attribute config.Attribute, val any) string

func FormatTime

func FormatTime(t *time.Time) string

FormatTime formats the specified time in the Dutch time zone and language

func FormatYear

func FormatYear(t *time.Time) string

FormatYear returns the year of the specied time.Time instance in the Dutch time zone

func NumberFormat

func NumberFormat(v interface{}) string

NumberFormat formats the specified number as string. IMPROVE: access an interface argument (or generic) and support multiple number types

func ToCheckboxValue

func ToCheckboxValue(v interface{}) []string

ToCheckboxValue converts the specified input to a slice of strings

func ToInputDate

func ToInputDate(d string) string

ToInputDate formats the specified date string, so it can be used as value for a datepicker input field

func ToInputDateTime

func ToInputDateTime(d string) string

ToInputDateTime formats the specified datetime string, so it can be used as value for a datetimepicker input field

func ToRadioValue

func ToRadioValue(v interface{}) string

ToRadioValue converts the specified input to a string

Types

type FormattedDate

type FormattedDate openapi_types.Date

FormattedDate is used to unmarshal date values in Dutch format directly from POST bodies

func (FormattedDate) IsZero

func (fd FormattedDate) IsZero() bool

func (FormattedDate) MarshalText

func (fd FormattedDate) MarshalText() ([]byte, error)

func (*FormattedDate) UnmarshalText

func (fd *FormattedDate) UnmarshalText(b []byte) error

type FormattedTime

type FormattedTime time.Time

FormattedTime is used to unmarshal datetime values in Dutch format directly from POST bodies

func (FormattedTime) IsZero

func (ft FormattedTime) IsZero() bool

func (FormattedTime) MarshalText

func (ft FormattedTime) MarshalText() ([]byte, error)

func (*FormattedTime) UnmarshalText

func (ft *FormattedTime) UnmarshalText(b []byte) error

Jump to

Keyboard shortcuts

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