本文整理汇总了C#中JsDate类的典型用法代码示例。如果您正苦于以下问题:C# JsDate类的具体用法?C# JsDate怎么用?C# JsDate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JsDate类属于命名空间,在下文中一共展示了JsDate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnReady
static void OnReady()
{
var today = new JsDate();
var birthdays = new JsArray<JsNumber> {
new JsDate(today.getFullYear(), today.getMonth(), 11).valueOf(),
new JsDate(today.getFullYear(), today.getMonth() + 1, 6).valueOf(),
new JsDate(today.getFullYear(), today.getMonth() + 1, 27).valueOf(),
new JsDate(today.getFullYear(), today.getMonth() - 1, 3).valueOf(),
new JsDate(today.getFullYear(), today.getMonth() - 2, 22).valueOf()
};
new jQuery("#datepicker").kendoDatePicker(new DatePickerConfiguration {
value = today,
month= new MonthConfiguration {
// template for dates in month view
content = "# if ($.inArray(+data.date, [" + birthdays + "]) != -1) { #" +
"<div class='birthday'></div>" +
"# } #" +
"#= data.value #"
},
footer = "Today - #=kendo.toString(data, 'd') #"
});
new jQuery("#datepicker").data("kendoDatePicker").As<DatePicker>();
//TODO: .dateView.calendar.element
//.width(300);
}
示例2: GetDate
private static JsDate GetDate(int? year, int month, int date)
{
var d = new JsDate();
if (year != null) {
d.setFullYear(year.Value);
}
d.setMonth(month);
d.setDate(date);
return d;
}
示例3: endChange
static void endChange()
{
var endDate = DatePickerGlobals.end.value().As<JsDate>();
if (endDate.As<JsBoolean>())
{
endDate = new JsDate(endDate.As<JsString>());
endDate.setDate(endDate.getDate() + 1);
DatePickerGlobals.start.min(endDate);
}
}
示例4: startChange
static void startChange()
{
var startDate = DatePickerGlobals.start.value().As<JsDate>();
if (startDate.As<JsBoolean>())
{
startDate = new JsDate(startDate.As<JsString>());
startDate.setDate(startDate.getDate() + 1);
DatePickerGlobals.end.min(startDate);
}
}
示例5: DateIsDst
/// <summary>
/// Checks whether a given date is in daylight saving time.
/// If the date supplied is after august, we assume that we're checking
/// for southern hemisphere DST.
/// </summary>
private static bool DateIsDst(JsDate date)
{
var is_southern = date.getMonth() > 7;
var base_offset = is_southern ? GetJuneOffset(date.getFullYear()) : GetJanuaryOffset(date.getFullYear());
var date_offset = GetDateOffset(date);
var is_west = base_offset < 0;
var dst_offset = base_offset - date_offset;
if (!is_west && !is_southern) {
return dst_offset < 0;
}
return dst_offset != 0;
}
示例6: update
/// <summary>
/// Update the contents of the picker
/// </summary>
/// <param name="date"><p>The new date</p>
/// </param>
/// <param name="forceRefresh"><p>True to force a full refresh</p>
/// </param>
private void update(JsDate date, bool forceRefresh){}
示例7: selectedUpdate
/// <summary>
/// Update the selected cell
/// </summary>
/// <param name="date"><p>The new date</p>
/// </param>
private void selectedUpdate(JsDate date){}
示例8: isLeapYear
/// <summary>
/// Checks if the current date falls within a leap year.
/// </summary>
/// <param name="date"><p>The date</p>
/// </param>
/// <returns>
/// <span><see cref="bool">Boolean</see></span><div><p>True if the current date falls within a leap year, false otherwise.</p>
/// </div>
/// </returns>
public static bool isLeapYear(JsDate date){return false;}
示例9: isDST
/// <summary>
/// Checks if the current date is affected by Daylight Saving Time (DST).
/// </summary>
/// <param name="date"><p>The date</p>
/// </param>
/// <returns>
/// <span><see cref="bool">Boolean</see></span><div><p>True if the current date is affected by DST.</p>
/// </div>
/// </returns>
public static bool isDST(JsDate date){return false;}
示例10: getTimezone
/// <summary>
/// Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
/// Note: The date string returned by the javascript Date object's toString() method varies
/// between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in America).
/// For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)",
/// getTimezone() first tries to get the timezone abbreviation from between a pair of parentheses
/// (which may or may not be present), failing which it proceeds to get the timezone abbreviation
/// from the GMT offset portion of the date string.
/// </summary>
/// <param name="date"><p>The date</p>
/// </param>
/// <returns>
/// <span><see cref="String">String</see></span><div><p>The abbreviated timezone name (e.g. 'CST', 'PDT', 'EDT', 'MPST' ...).</p>
/// </div>
/// </returns>
public static JsString getTimezone(JsDate date){return null;}
示例11: getLastDayOfMonth
/// <summary>
/// Get the last day of the current month, adjusted for leap year. The returned value
/// is the numeric day index within the week (0-6) which can be used in conjunction with
/// the monthNames array to retrieve the textual day name.
/// Example:
/// <code>var dt = new Date('1/10/2007'),
/// lastDay = <see cref="Ext.Date.getLastDayOfMonth">Ext.Date.getLastDayOfMonth</see>(dt);
/// console.log(<see cref="Ext.Date.dayNames">Ext.Date.dayNames</see>[lastDay]); //output: 'Wednesday'
/// </code>
/// </summary>
/// <param name="date"><p>The date</p>
/// </param>
/// <returns>
/// <span><see cref="Number">Number</see></span><div><p>The day number (0-6).</p>
/// </div>
/// </returns>
public static JsNumber getLastDayOfMonth(JsDate date){return null;}
示例12: setMinValue
/// <summary>
/// Set the minValue and update the list of available times. This must be a Date object (only the time
/// fields will be used); no parsing of String values will be done.
/// </summary>
/// <param name="value">
/// </param>
public void setMinValue(JsDate value){}
示例13: setMaxValue
/// <summary>
/// Set the maxValue and update the list of available times. This must be a Date object (only the time
/// fields will be used); no parsing of String values will be done.
/// </summary>
/// <param name="value">
/// </param>
public void setMaxValue(JsDate value){}
示例14: normalizeDate
/// <summary>
/// Sets the year/month/day of the given Date object to the initDate, so that only
/// the time fields are significant. This makes values suitable for time comparison.
/// </summary>
/// <param name="date">
/// </param>
private void normalizeDate(JsDate date){}
示例15: getGMTOffset
/// <summary>
/// Get the offset from GMT of the current date (equivalent to the format specifier 'O').
/// </summary>
/// <param name="date"><p>The date</p>
/// </param>
/// <param name="colon"><p>true to separate the hours and minutes with a colon (defaults to false).</p>
/// </param>
/// <returns>
/// <span><see cref="String">String</see></span><div><p>The 4-character offset string prefixed with + or - (e.g. '-0600').</p>
/// </div>
/// </returns>
public static JsString getGMTOffset(JsDate date, object colon=null){return null;}