Skip to content

Commit

Permalink
fix time parse error (#37) (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
elvis972602 committed Oct 20, 2023
1 parent c5f985c commit b2c42e7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kemono/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"github.com/elvis972602/kemono-scraper/utils"
"github.com/spf13/cast"
"net/url"
"path/filepath"
"time"
Expand Down Expand Up @@ -110,9 +111,9 @@ type PostRaw struct {

func (p PostRaw) ParasTime() Post {
var post Post
post.Added, _ = time.Parse(time.RFC1123, p.Added)
post.Edited, _ = time.Parse(time.RFC1123, p.Edited)
post.Published, _ = time.Parse(time.RFC1123, p.Published)
post.Added, _ = cast.StringToDate(p.Added)
post.Edited, _ = cast.StringToDate(p.Edited)
post.Published, _ = cast.StringToDate(p.Published)
post.Id = p.Id
post.Service = p.Service
post.Title = p.Title
Expand Down

0 comments on commit b2c42e7

Please sign in to comment.