mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
Resolve #11.
This commit is contained in:
@ -18,6 +18,10 @@ func FormatDate(date time.Time) string {
|
||||
return date.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
|
||||
func FormatDateHuman(date time.Time) string {
|
||||
return date.Format("Mon, 02 Jan 2006 15:04")
|
||||
}
|
||||
|
||||
func ParseUserAgent(ua string) (string, string, error) {
|
||||
re := regexp.MustCompile(`^wakatime\/[\d+.]+\s\((\w+).*\)\s.+\s(\w+)\/.+$`)
|
||||
groups := re.FindAllStringSubmatch(ua, -1)
|
||||
|
Reference in New Issue
Block a user