GCal Python:创建新事件时没有任何时间(只有日期)吗?

时间:2019-01-13 05:08:04

标签: python google-calendar-api

通常使用Google日历时,我可以在时间轴上方(每个日期下方的空白处)单击鼠标,在其中可以设置提醒和事件,而没有时间显示在最上方。有没有办法像python那样添加没有时间(只有一天)的事件?我尝试只将没有时间的日期作为dateTime的值,但是我收到关于时间范围为空的错误。

1 个答案:

答案 0 :(得分:0)

您可以使用events.insert public function mod_edit_confirm() { $data = $this->Session->read('data_product_edit'); $title = 'Product Edit Confirmation'; $button = 'Update'; $link = '/products/edit/'.$data['MstProduct']['id']; $product_type = $this->MstProductType->findById($data['MstProduct']['product_type_id']); if(isset($data['MstProduct']['sales_price']) && $data['MstProduct']['sales_price'] != ''){ $data['MstProduct']['sales_price'] = number_format($data['MstProduct']['sales_price']); } if(isset($data['MstProduct']['adjustment_of_amount_of_tax_exclusive']) && $data['MstProduct']['adjustment_of_amount_of_tax_exclusive'] != ''){ $data['MstProduct']['adjustment_of_amount_of_tax_exclusive'] = number_format($data['MstProduct']['adjustment_of_amount_of_tax_exclusive']); } if(isset($data['MstProduct']['price_of_option_or_goods']) && $data['MstProduct']['price_of_option_or_goods'] != ''){ $data['MstProduct']['price_of_option_or_goods'] = number_format($data['MstProduct']['price_of_option_or_goods']); } if(isset($data['MstProduct']['display_price_without_tax']) && $data['MstProduct']['display_price_without_tax'] != ''){ $data['MstProduct']['display_price_without_tax'] = number_format($data['MstProduct']['display_price_without_tax']); } if(isset($data['MstProduct']['amount_of_charge_points']) && $data['MstProduct']['amount_of_charge_points'] != ''){ $data['MstProduct']['amount_of_charge_points'] = number_format($data['MstProduct']['amount_of_charge_points']); } if(isset($data['MstProduct']['amount_of_bonus_points']) && $data['MstProduct']['amount_of_bonus_points'] != ''){ $data['MstProduct']['amount_of_bonus_points'] = number_format($data['MstProduct']['amount_of_bonus_points']); } $category = $this->Category->findById($data['MstProduct']['category_id']); if ($this->request->is('post')) { //click register product if (isset($this->request->data['Save'])) { $data = $this->Session->read('data_product_edit'); if ($data['MstProduct']['color_1'] != '') $data['MstProduct']['color_1'] = trim($data['MstProduct']['color_1'],"#"); if ($data['MstProduct']['color_2'] != '') $data['MstProduct']['color_2'] = trim($data['MstProduct']['color_2'],"#"); unset($data['MstProduct']['end_radio']); unset($data['MstProduct']['start_radio']); unset($data['MstProduct']['category1']); unset($data['MstProduct']['category2']); unset($data['MstProduct']['category3']); unset($data['MstProduct']['category4']); unset($data['MstProduct']['category5']); unset($data['Confirm']); $this->MstProduct->id = $data['MstProduct']['id']; if ($this->MstProduct->save($data)) { // here is where i get my datalogs $sample=$this->MstProduct->getDataSource()->getLog(false, false); $this->Session->delete('data_product_edit'); if ($data['MstProduct']['product_type_id'] == 1) { $this->MstProduct->saveField('amount_of_charge_points', ''); } else if ($data['MstProduct']['product_type_id'] == 2) { $this->MstProduct->saveField('treatment_minutes', ''); } else { $this->MstProduct->saveField('treatment_minutes', ''); $this->MstProduct->saveField('amount_of_charge_points', ''); } $this->Flash->success(__d('admin', 'Successfully Updated.')); return $this->redirect('/products/edit/complete'); } else { $this->Flash->error(__d('admin', 'Updated Faild.')); return $this->redirect('/products/edit/'.$data['MstProduct']['id']); } } else if (isset($this->request->data['Cancel'])) { $this->Session->delete('data_product_edit'); return $this->redirect('/products'); } } $this->set(compact('data', 'product_type', 'title', 'link', 'category', 'button')); $this->render("mod_add_confirm"); } 属性代替date

  
      
  • 结束日期日期      
        
    • 如果是全天活动,则格式为“ yyyy-mm-dd”的日期。
    •   
  •   
  • 开始日期日期      
        
    • 如果是全天活动,则格式为“ yyyy-mm-dd”的日期。
    •   
  •   

dateTime属性描述为:

  

时间,以组合的日期时间值(格式为   RFC3339)。除非时区为   在timeZone中明确指定。