Add Time method to Date struct for accessing internal timestamp
This commit is contained in:
parent
572d868c24
commit
a96b765794
1 changed files with 6 additions and 2 deletions
|
|
@ -58,8 +58,8 @@ var DropCmd = &cobra.Command{
|
|||
for k, v := range fields {
|
||||
ms.AppendTo(k, tools.ParseString(v))
|
||||
}
|
||||
e := models.Entry{title, d.t, *ms}
|
||||
l := models.Log{log, []models.Entry{e}}
|
||||
e := models.Entry{Title: title, Date: d.Time(), Fields: *ms}
|
||||
l := models.Log{Name: log, Entries: []models.Entry{e}}
|
||||
err := files.Append(l)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -126,3 +126,7 @@ func (d *Date) Set(in string) (err error) {
|
|||
func (d *Date) Type() string {
|
||||
return "datetime"
|
||||
}
|
||||
|
||||
func (d Date) Time() time.Time {
|
||||
return d.t
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue