我正在创建一个google工作表,需要设置一个日期格式的单元格。我使用的是here
的引用我的代码如下:
$format_requests = array();
$format_requests[] = array(
'addConditionalFormatRule' => array(
'rule' => array(
'ranges' => array(array(
"sheetId" => 0,
"startRowIndex" => 0,
"startColumnIndex" => 1,
"endColumnIndex" => 1
)),
"booleanRule" => array(
// "condition" => array(
// )
"format" => array(
"numberFormat" => array(
"type" => "DATE",
"pattern" => "dddd, mmmm d yyyy"
)
)
)
)
)
);
$format = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(array('requests' => $format_requests));
$format_result = $service->spreadsheets->batchUpdate($spreadsheetId, $format);
但是我收到以下错误:
Invalid requests[0].addConditionalFormatRule: ConditionalFormatRule.format only supports bold, italic, strikethrough, foreground color and background color.