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;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by