I have to paste a date. For what I understood in the docs and SO is that I have to paste the days passed from 30 dec 1899 and format the cell as date.
Been the last hour looking for an example of formatting using the Go API client. Any example?
Thanks!
Edit: my code!
Google libs used:
"google.golang.org/api/option"
"google.golang.org/api/sheets/v4"
Function:
func googleAppend(bookID, sheet, tableCorner string, data []interface{}) {
srv := connect(key)
var vr sheets.ValueRange
vr.Values = append(vr.Values, data)
_, err := srv.Spreadsheets.Values.Append(bookID,
sheet+"!"+tableCorner, &vr).ValueInputOption("RAW").Do()
if err != nil {
log.Fatalf("Unable to retrieve data from sheet. %v", err)
}
}
Tested with:
func Test_googleAppend(t *testing.T) {
sample := []interface{}{"swwewewew", 3, 47120} <-- for what I understand, the destination of 3434343 should be formated to DATE.
googleAppend("XXX", "SHEET", "A1", sample)
}
