Enum RelativeDate
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Ngày tương đối
Một enum đại diện cho các tuỳ chọn ngày tương đối để tính toán giá trị sẽ được sử dụng trong BooleanCriteria
dựa trên ngày.
Để gọi một enum, bạn gọi lớp mẹ, tên và thuộc tính của enum đó. Ví dụ:
SpreadsheetApp.RelativeDate.TODAY
.
Thuộc tính
Thuộc tính | Loại | Mô tả |
TODAY | Enum | Ngày so sánh với ngày hiện tại. |
TOMORROW | Enum | Ngày được so sánh với ngày sau ngày hiện tại. |
YESTERDAY | Enum | Ngày được so sánh với ngày trước ngày hiện tại. |
PAST_WEEK | Enum | Ngày nằm trong khoảng thời gian một tuần trước. |
PAST_MONTH | Enum | Ngày nằm trong khoảng thời gian một tháng qua. |
PAST_YEAR | Enum | Ngày trong khoảng thời gian một năm qua. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eRelativeDate\u003c/code\u003e is used within \u003ccode\u003eBooleanCriteria\u003c/code\u003e for date-based comparisons in Google Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eIt offers various properties like \u003ccode\u003eTODAY\u003c/code\u003e, \u003ccode\u003ePAST_WEEK\u003c/code\u003e, etc., representing different relative date periods.\u003c/p\u003e\n"],["\u003cp\u003eTo use it, call the parent class, name, and property, for example, \u003ccode\u003eSpreadsheetApp.RelativeDate.TODAY\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Enum RelativeDate\n\nRelativeDate\n\nAn enumeration representing the relative date options for calculating a value to be used in\ndate-based [BooleanCriteria](/apps-script/reference/spreadsheet/boolean-criteria).\n\nTo call an enum, you call its parent class, name, and property. For example, `\nSpreadsheetApp.RelativeDate.TODAY`. \n\n### Properties\n\n| Property | Type | Description |\n|--------------|--------|----------------------------------------------------------|\n| `TODAY` | `Enum` | Dates compared against the current date. |\n| `TOMORROW` | `Enum` | Dates compared against the date after the current date. |\n| `YESTERDAY` | `Enum` | Dates compared against the date before the current date. |\n| `PAST_WEEK` | `Enum` | Dates that fall within the past week period. |\n| `PAST_MONTH` | `Enum` | Dates that fall within the past month period. |\n| `PAST_YEAR` | `Enum` | Dates that fall within the past year period. |"]]