parser.FormatSanitize() MetaDataFormat for date too
authorAnthony Fok <foka@debian.org>
Sun, 8 Feb 2015 16:50:01 +0000 (09:50 -0700)
committerAnthony Fok <foka@debian.org>
Sun, 8 Feb 2015 16:55:20 +0000 (09:55 -0700)
So that the date would come out correctly with
variations like `MetaDataFormat = "YAML"` in addition to
the normally expected `MetaDataFormat = "yaml"`.

Fixes #865.

create/content.go

index 98b3652a4e084c01521abcb1bb33ec8870371f2a..fa37f266649924f3e2356ecda38c76b7351129fd 100644 (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)
        }