parser.FormatSanitize() MetaDataFormat for date too

So that the date would come out correctly with
variations like `MetaDataFormat = "YAML"` in addition to
the normally expected `MetaDataFormat = "yaml"`.

Fixes #865.
This commit is contained in:
Anthony Fok 2015-02-08 09:50:01 -07:00
parent 08219161dd
commit 088d46a804

View file

@ -98,7 +98,7 @@ func NewContent(kind, name string) (err error) {
return err
}
if x := viper.GetString("MetaDataFormat"); x == "json" || x == "yaml" || x == "toml" {
if x := parser.FormatSanitize(viper.GetString("MetaDataFormat")); x == "json" || x == "yaml" || x == "toml" {
newmetadata["date"] = time.Now().Format(time.RFC3339)
}