diff --git a/README.md b/README.md index 105875e..52af935 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ It expects that the json input is formatted as an object containing an array of |---------------|---------------|---------------------------| | inputJson | input.json | File path of the input json to process | | outputFilename | output.xlsx | File path of the output file | -| worksheetName | Sheet1 | Set the name of the worksheet | +| worksheetName | Sheet1 | Set the name of the worksheet, will be truncated to 31 characters | | boldTopRow | true | Sets the top row of the worksheet to bold | | freezeTopRow | true | Freezes the first row of the Excel worksheet | | autofilter | true | Sets the auto filter on the first row | diff --git a/cmd/main/main.go b/cmd/main/main.go index 83979b9..48dbb31 100644 --- a/cmd/main/main.go +++ b/cmd/main/main.go @@ -6,6 +6,7 @@ import ( "fmt" "log" "os" + "time" "unicode/utf8" "github.com/iancoleman/orderedmap" @@ -92,6 +93,15 @@ func main() { fmt.Printf("Error setting sheet name to '%s': %s\n", worksheetName, err) } } + + // Set the document properties + err := xlsx.SetDocProps(&excelize.DocProperties{ + Creator: "json2excel", + Created: time.Now().Format(time.RFC3339), + }) + if err != nil { + fmt.Printf("Error setting document properties: %s\n", err) + } } // Read the json input file