ui.DateSlider
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Przeciągany cel, który zmienia się liniowo między 2 datami. Suwak dat można skonfigurować tak, aby wyświetlał daty w różnych przedziałach czasowych, np. w dniach, 8-dniowych okresach i latach. Wartość suwaka jest wyświetlana jako etykieta obok niego.
Wykorzystanie | Zwroty |
---|
ui.DateSlider(start, end, value, period, onChange, disabled, style) | ui.DateSlider |
Argument | Typ | Szczegóły |
---|
start | Date|Number|String, opcjonalnie | Data rozpoczęcia w formacie sygnatury czasowej UTC, ciągu znaków daty lub ee.Date. Domyślnie jest to tydzień temu. |
end | Date|Number|String, opcjonalnie | Data zakończenia w formacie sygnatury czasowej UTC, ciągu znaków daty lub ee.Date. Domyślnie jest to dzisiejsza data. |
value | Date|Number|String, opcjonalnie | Wartość początkowa. Wartość jest tablicą składającą się z daty rozpoczęcia i zakończenia wybranego zakresu dat, ale dla wygody można ją ustawić, podając tylko datę rozpoczęcia. Domyślnie jest to wczoraj. |
period | Numer, opcjonalny | Rozmiar przedziału wartości na suwaku w dniach. Domyślna wartość to 1. |
onChange | Funkcja (opcjonalnie) | Funkcja wywołania zwrotnego, która ma zostać uruchomiona, gdy zmieni się stan suwaka. Funkcja wywołania zwrotnego otrzymuje obiekt ee.DateRange reprezentujący bieżącą wartość suwaka i widżet suwaka. |
disabled | Wartość logiczna, opcjonalna | Określa, czy suwak jest wyłączony. Wartość domyślna to fałsz. |
style | Obiekt (opcjonalnie) | Obiekt dozwolonych stylów CSS z wartościami, które mają być ustawione dla tego widżetu. Domyślnie jest to pusty obiekt. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003eThe DateSlider widget provides a user interface for selecting a date range on a linear scale.\u003c/p\u003e\n"],["\u003cp\u003eIt offers flexibility in displaying various date intervals, including day, 8-day, and year.\u003c/p\u003e\n"],["\u003cp\u003eUsers can customize the start and end dates, initial value, interval size, and add event listeners for changes.\u003c/p\u003e\n"],["\u003cp\u003eThe slider displays a label indicating the selected date range and supports both single date selection and range selection.\u003c/p\u003e\n"],["\u003cp\u003eStyling options are available to modify the appearance of the widget.\u003c/p\u003e\n"]]],[],null,["# ui.DateSlider\n\n\u003cbr /\u003e\n\nA draggable target that ranges linearly between two dates. The date slider can be configured to display dates of various interval sizes, including day, 8-day, and year. The value of the slider is displayed as a label alongside it.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------------------------------------------------------------|---------------|\n| `ui.DateSlider(`*start* `, `*end* `, `*value* `, `*period* `, `*onChange* `, `*disabled* `, `*style*`)` | ui.DateSlider |\n\n| Argument | Type | Details |\n|------------|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `start` | Date\\|Number\\|String, optional | The start date, as a UTC timestamp, date string, or ee.Date. Defaults to one week ago. |\n| `end` | Date\\|Number\\|String, optional | The end date, as a UTC timestamp, date string, or ee.Date. Defaults to today. |\n| `value` | Date\\|Number\\|String, optional | The initial value. The value is an array consisting of the start and end date for the selected date range, but for convenience, it can be set by specifying the start date alone. Defaults to yesterday. |\n| `period` | Number, optional | The interval size for values on the slider in days. Defaults to one. |\n| `onChange` | Function, optional | A callback to fire when the slider's state changes. The callback is passed an ee.DateRange representing the slider's current value and the slider widget. |\n| `disabled` | Boolean, optional | Whether the slider is disabled. Defaults to false. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this widget. Defaults to an empty object. |"]]