Google Sheet API V4日期格式单元格PHP JSON

时间:2018-05-04 08:06:48

标签: php google-sheets-api

我正在创建一个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.

0 个答案:

没有答案