How to disable a whole range of dates in "uidatepicker"?

6 ビュー (過去 30 日間)
Lior Embon
Lior Embon 2018 年 5 月 2 日
コメント済み: Ameer Hamza 2018 年 5 月 3 日
I've added a uidatepicker to a GUI I'm building. I'd like to have a range of available dates and disable the rest according to some logic. I could only find the option to disable specific dates (or days of the week and so on).
Does anyone know of a way to define a range?
Thanks

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 5 月 2 日
編集済み: Ameer Hamza 2018 年 5 月 2 日
You can define a range of dates using
date_range = datetime('01/01/2018', 'InputFormat', 'dd/MM/yyyy'):datetime('29/03/2018', 'InputFormat', 'dd/MM/yyyy');
and then use it to disable dates
Myuidatepicker.DisabledDates = date_range;
  2 件のコメント
Lior Embon
Lior Embon 2018 年 5 月 3 日
Thank you :)
Ameer Hamza
Ameer Hamza 2018 年 5 月 3 日
You are welcome.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by