1. Home
  2. Docs
  3. DatePicker by Bitsplash
  4. Accessing the date picker from script

Accessing the date picker from script

The date picker is accessed through the DatePickerSettings component and the DatePickerContent component.

use the following source to obtain access to the date picker:

var settings = GetComponent<DatePickerSettings>();
settings.Content. <you method> () to change the content

settings.Content.Selection. <your method> to modify or query the date selection

Use case example : Selecting a date range programatically

settings.Content.SelectRange(DateTime.Today,DateTime.Today +TimeSpan.FromDays(5).

Use case example : chainging the First day of the week programatically

settings.Content.FirstDayOfWeek = DayOfWeek.Monday;