flymis/WebRoot/dojojs/src/date/format.js
(开头部分) 28KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.date.format");
dojo.require("dojo.date.common");
dojo.require("dojo.date.supplemental");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.func");
dojo.require("dojo.string.common");
dojo.require("dojo.i18n.common");
// Load the bundles containing localization information for
// names and formats
dojo.requireLocalization("dojo.i18n.calendar", "gregorian");
dojo.requireLocalization("dojo.i18n.calendar", "gregorianExtras");
//NOTE: Everything in this module assumes Gregorian calendars.
// Other calendars will be implemented in separate modules.
(function(){
dojo.date.format = function(/*Date*/dateObject, /*Object?*/options){
//
// summary:
// Format a Date object as a String, using locale-specific settings.
//
// description:
// Create a string from a Date object using a known localized pattern.
// By default, this method formats both date and time from dateObject.
// Formatting patterns are chosen appropriate to the locale. Different
// formatting lengths may be chosen, with "full" used by default.
// Custom patterns may be used or registered with translations using
// the addCustomBundle method.
// Formatting patterns are implemented using the syntax described at
// http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns
//
// dateObject:
// the date and/or time to be formatted. If a time only is formatted,
// the values in the year, month, and day fields are irrelevant. The
// opposite is true when formatting only dates.
//
// options: object {selector: string, formatLength: string, datePattern: string, timePattern: string, locale: string}
// selector- choice of timeOnly,dateOnly (default: date and time)
// formatLength- choice of long, short, medium or full (plus any custom additions). Defaults to 'full'
// datePattern,timePattern- override pattern with this string
// am,pm- override strings for am/pm in times
// locale- override the locale used to determine formatting rules
//
if(typeof options == "string"){
dojo.deprecated("dojo.date.format", "To format dates with POSIX-style strings, please use dojo.date.strftime instead", "0.5");
return dojo.date.strftime(dateObject, options);
后面还有 862 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。