Code covered by the BSD License  

Highlights from
UIGETDATE

4.83333

4.8 | 12 ratings Rate this file 31 Downloads (last 30 days) File Size: 3.42 KB File ID: #8313
image thumbnail

UIGETDATE

by

 

18 Aug 2005 (Updated )

UIGETDATE displays a dialog box in form of a calendar.

| Watch this File

File Information
Description

UIGETDATE date selection dialog box
   T = UIGETDATE(D) displays a dialog box in form of a calendar
   
   UIGETDATE expects serial date number or standard MATLAB Date
   format (see DATESTR) as input data und returns serial date number
   for the selected date and time.

   UIGETDATE by itself uses the current date and time as input data

Example:
        t = datestr( uigetdate('16-Aug-1974 03:00') )

See also datevec, datestr, datenum

Acknowledgements

This file inspired Plot Me The Greeks and Uisetdate2.

MATLAB release MATLAB 7.0.4 (R14SP2)
Other requirements tested under R13/R13SP1/R14/R14SP1/R14SP2/R14SP3
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (15)
25 Jan 2014 per isakson

uigetdate has served well for many years, but now the new version of datenum (R2013b?) issues an error.

Fix:

% tmp = {'Januar' 'Februar' 'March' 'April' 'May' 'Juni' 'Juli' ...
% 'August' 'September' 'October' 'November' 'December'};
tmp = {'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'};

and

out = datenum([num2str( ...
get(findobj(gcf,'Tag','cday'),'UserData')) '-' ...
get(findobj(gcf,'Tag','months'),'String') '-' ...
get(findobj(gcf,'Tag','year' ),'String') ' ' ...
get(findobj(gcf,'Tag','time' ),'String') ':00'] ...
, 'dd-mmm-yyyy HH:MM:SS' );

I added the format specifier.

Now it seems to work again.

20 Aug 2013 Yaad

GREAT work!

16 Aug 2013 JY Su

Amazing !!

22 Aug 2012 Liam Kelly

Great tool. However, it will not compile as a stand alone application with the MCR compiler because of the use of strings as callback functions (e.g. ...'callback','uigetdate(gcbo,''year'')')

22 Aug 2012 Liam Kelly  
27 Jul 2011 Jan Simon

Hi Elmar! This is the the nicest and coolest GUI built by conventional MATLAB methods I've ever seen. Beside the usability, it is an excellent example for advanced programmers. Thanks!

17 Dec 2010 Deshan Yang

Fantastic. It is exactly what I need.

15 Jun 2010 Vincent De Paul

This is a fantastic DateGUI, as Matlab doesn't have such utilities. It can be easily integrated in any Matlab code, in which a calendar is need.

Great Job

09 Apr 2010 Tal Shir

Sorry for adding the rating twice. a small point is the try catch lines. If the gui is used in a parent gui the closereq command will close the main gui in case the x button was used to close the uigetdate. a solution can be to add the following lines between catch and end:
out = [];
if strcmp(get(gcf,'tag'),'uigetdate') % close only if calander is not close already
closereq
end

03 Jun 2008 Gilles Criton

I have not yet practice a full test in order to see if there are some bugs, but at first glance, this function is very impressive and useful ! Thank you very much

16 Aug 2007 Blaz Daskobler

Indeed a very handy tool, thanks a lot.
But, as a previous user observed, the "closereq" command (line 120 to be precise, not 127) needs to be commented out.
You close the uigetdate figure with the "X" (or Close) anyway, and that's why that "closereq" command closes the figure calling uigetdate.

04 Jan 2007 per isakson

It looks nice and works well. However, I encounter a minor issue. When I click the Close Button in the Title Bar "my" figure is closed together with the uigetdate figure. By stepping through the code with the debugger I see that <line 117 uiwait> closes the uigetdate figure and that <line 127 closereq> closes my figure. Don't ask me why (R2006b)! Commenting out <line 127> seems to solve the issue.

26 Oct 2006 Malcolm Wood

This is really impressive.

10 Aug 2006 Kevin Delaney

Just what I was looking for!

30 Aug 2005 Andreas Geissler

Hello, the M-File works great.
No problems !

Contact us