t

ref: master

models/models.go


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
package models

import (
	"strings"
	"time"
)

type Note struct {
	Name    string
	Path    string
	ModTime time.Time
}

func (note *Note) Title() string {
	return strings.Split(note.Name, ".")[0]
}

func (note *Note) UpdatedAt() string {
	return note.ModTime.Format("Mon, Jan _2 15:04:05 2006")
}