admin_field_now

package module
v0.0.0-...-8df6480 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 5 Imported by: 1

README

admin-field-now

Admin field to show current timestamp for Ecletus

Documentation

Index

Constants

View Source
const (
	FieldName  = "Now"
	TimeFormat = time.Stamp + " GMT -07:00"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name  string
	Label string

	// Layout time format layout
	Layout       string
	FormatFunc   func(recorde interface{}, context *core.Context, now time.Time) string
	Location     *time.Location
	LocationFunc func(recorde interface{}, context *core.Context) *time.Location
	NowFunc      func(recorde interface{}, context *core.Context) time.Time
}

func Setup

func Setup(f *Field, res *admin.Resource) *Field

func (Field) Apply

func (f Field) Apply(res *admin.Resource) *Field

func (Field) Format

func (f Field) Format(recorde interface{}, context *core.Context) string

func (Field) Now

func (f Field) Now(recorde interface{}, context *core.Context) time.Time

func (Field) Setup

func (f Field) Setup() Field

Jump to

Keyboard shortcuts

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