Type | Description | |||
Date as Date | A Date expression that indicates the start date. | |||
Unit as UnitEnum | An UnitEnum expression that indicates the time unit to change the date. | |||
Count as Variant | A long expression that indicates the number of time units | |||
Date | A Date expression that indicates the result. |
The following VB sample displays the next day as "Tue, May 31, 2005":
With Gantt1.Chart Debug.Print .FormatDate(.NextDate(.FirstVisibleDate, exDay, 2), "<%ddd%>, <%mmmm%> <%d%>, <%yyyy%>") End With
The following C++ sample displays the next day as "Tue, May 31, 2005":
CChart chart = m_gantt.GetChart(); DATE d = chart.GetNextDate( V2D( &chart.GetFirstVisibleDate() ), 4096, COleVariant( (long)1 ) ); CString strFormat = chart.GetFormatDate( d, "<%ddd%>, <%mmmm%> <%d%>, <%yyyy%>" ); OutputDebugString( strFormat );
where the V2D function converts a Variant expression to a DATE expression:
static DATE V2D( VARIANT* pvtDate ) { COleVariant vtDate; vtDate.ChangeType( VT_DATE, pvtDate ); return V_DATE( &vtDate ); }
The following VB.NET sample displays the next day as "Tue, May 31, 2005":
With AxGantt1.Chart Debug.Write(.FormatDate(.NextDate(.FirstVisibleDate, EXGANTTLib.UnitEnum.exDay, 2), "<%ddd%>, <%mmmm%> <%d%>, <%yyyy%>")) End With
The following C# sample displays the next day as "Tue, May 31, 2005":
DateTime d = Convert.ToDateTime( axGantt1.Chart.get_NextDate(Convert.ToDateTime(axGantt1.Chart.FirstVisibleDate), EXGANTTLib.UnitEnum.exDay, 1) ); String strFormat = axGantt1.Chart.get_FormatDate(d, "<%ddd%>, <%mmmm%> <%d%>, <%yyyy%>"); System.Diagnostics.Debug.Write(strFormat);
The following VFP sample displays the next day as "Tue, May 31, 2005":
With thisform.Gantt1.Chart wait window nowait .FormatDate(.NextDate(.FirstVisibleDate, 4096, 2), "<%ddd%>, <%mmmm%> <%d%>, <%yyyy%>") EndWith