View Categories

Minimum Year Range

Description

This property allows you to define minimum range of years to show on Year Scroll Field.

You may want to show a certain number of years from the past to your users so that they are able select dates such as a birthday or a past event etc. In that case, you should set the YearRangeMin to an appropriate number such as 100. This will give users the option to select from 101 years including the current year.

You can set this option along with YearRangeMax at the same time to give your users a wide range of years to choose from. However, be aware that using large values may cause performance issues. In addition, both of these values are relative to the current year. You may set both values to zero but the current year will always be visible.

Type

Int

Syntax

AMADatePicker.ADP.YearRangeMin = 100; 

Example

using UnityEngine;
using AMADatePicker;

public class DateViewer : MonoBehavior

// Get reference to an ADP instance through the inspector
[SerializeField] private ADP _ADPInstance;

// Considering current year as 2021...
// ...(at the time of documentation)...
// ...the year range available...
// ...will be 1921 to 2071.
private void Start()
{
    AMADatePicker.ADP.YearRangeMin = 100;
    AMADatePicker.ADP.YearRangeMax = 50;
} 

Leave a Reply

Your email address will not be published. Required fields are marked *