commands: Improve jekyll import date format

Allow both yyyy-mm-dd and yyyy-m-d formats in jekyll markdown
file names.
This commit is contained in:
Anthony Kong 2017-03-13 22:50:57 +11:00 committed by Bjørn Erik Pedersen
parent 4b9493cb03
commit 62efcdfed4

View file

@ -372,7 +372,7 @@ func parseJekyllFilename(filename string) (time.Time, string, error) {
return time.Now(), "", errors.New("filename not match")
}
postDate, err := time.Parse("2006-01-02", r[0][1])
postDate, err := time.Parse("2006-1-2", r[0][1])
if err != nil {
return time.Now(), "", err
}