added evaluation for toml for metadataformat date handling

This commit is contained in:
Joel Scoble 2014-08-17 22:02:52 -05:00 committed by spf13
parent 27c0ec3163
commit b10dea2955
2 changed files with 2 additions and 2 deletions

View file

@ -117,7 +117,7 @@ func convertContents(mark rune) (err error) {
}
// better handling of dates in formats that don't have support for them
if mark == parser.FormatToLeadRune("json") || mark == parser.FormatToLeadRune("yaml") {
if mark == parser.FormatToLeadRune("json") || mark == parser.FormatToLeadRune("yaml") || mark == parser.FormatToLeadRune("toml") {
newmetadata := cast.ToStringMap(metadata)
for k, v := range newmetadata {
switch vv := v.(type) {

View file

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