package types

import (
	
	
)

const DateFormat = "2006-01-02"

type Date struct {
	time.Time
}

func ( Date) () ([]byte, error) {
	return json.Marshal(.Time.Format(DateFormat))
}

func ( *Date) ( []byte) error {
	var  string
	 := json.Unmarshal(, &)
	if  != nil {
		return 
	}
	,  := time.Parse(DateFormat, )
	if  != nil {
		return 
	}
	.Time = 
	return nil
}

func ( Date) () string {
	return .Time.Format(DateFormat)
}

func ( *Date) ( []byte) error {
	,  := time.Parse(DateFormat, string())
	if  != nil {
		return 
	}
	.Time = 
	return nil
}