constdateTimePicker=CardService.newDatePicker().setTitle('Enter the date.').setFieldName('date_field')// Set default value as Jan 1, 2018 UTC. Either a number or string is// acceptable..setValueInMsSinceEpoch(1514775600).setOnChangeAction(CardService.newAction().setFunctionName('handleDateTimeChange'),);
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-01-30 (世界標準時間)。"],[[["The `DatePicker` is an input field allowing users to select a date, available for use in Google Workspace Add-ons and Google Chat apps."],["It offers methods to set a field name for event handling, trigger actions on input changes, provide a title for clarity, and pre-fill a default date value."],["The `setValueInMsSinceEpoch` method accepts either a number or a string representing milliseconds since the epoch to set the default date."],["All configuration methods for the `DatePicker` are chainable, allowing for concise and readable code when setting multiple properties."]]],["The `DatePicker` component, available for Google Workspace add-ons and Google Chat apps, creates a date input field. Key actions include setting the `fieldName` to identify the picker in UI interactions, defining an `onChangeAction` for script execution upon input changes, and setting a `title` for the field. You can also set a default `valueInMsSinceEpoch` as a number or string. Each method returns the `DatePicker` object, enabling method chaining.\n"]]