{"size": 2620, "ext": "js", "max_stars_repo_path": "Gateway/wwwroot/lib/globalize/src/date-runtime.js", "max_stars_repo_name": "MaslovRG/weblibrary", "max_stars_repo_stars_event_min_datetime": "2016-11-02T18:56:16.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T06:51:52.000Z", "max_issues_repo_path": "src/date-runtime.js", "max_issues_repo_name": "JamesMGreene/globalize", "max_issues_repo_issues_event_min_datetime": "2016-11-02T18:00:29.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-20T00:26:08.000Z", "max_forks_repo_path": "src/date-runtime.js", "max_forks_repo_name": "JamesMGreene/globalize", "max_forks_repo_forks_event_min_datetime": "2016-11-02T20:08:33.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-30T06:51:53.000Z"}
{"max_stars_count": 2247, "max_issues_count": 314, "max_forks_count": 293, "avg_line_length": 29.4382022472, "max_line_length": 94, "alphanum_fraction": 0.7381679389}
define([
	"./common/runtime-key",
	"./common/validate/parameter-presence",
	"./common/validate/parameter-type/date",
	"./common/validate/parameter-type/string",
	"./core-runtime",
	"./date/format",
	"./date/formatter-fn",
	"./date/parse",
	"./date/parser-fn",
	"./date/tokenizer",
	"./date/to-parts-formatter-fn",

	"./number-runtime"
], function( runtimeKey, validateParameterPresence, validateParameterTypeDate,
	validateParameterTypeString, Globalize, dateFormat, dateFormatterFn, dateParse, dateParserFn,
	dateToPartsFormatterFn, dateTokenizer ) {

Globalize._dateFormat = dateFormat;
Globalize._dateFormatterFn = dateFormatterFn;
Globalize._dateParser = dateParse;
Globalize._dateParserFn = dateParserFn;
Globalize._dateTokenizer = dateTokenizer;
Globalize._dateToPartsFormatterFn = dateToPartsFormatterFn;
Globalize._validateParameterTypeDate = validateParameterTypeDate;

function optionsHasStyle( options ) {
	return options.skeleton !== undefined ||
		options.date !== undefined ||
		options.time !== undefined ||
		options.datetime !== undefined ||
		options.raw !== undefined;
}

Globalize.dateFormatter =
Globalize.prototype.dateFormatter = function( options ) {
	options = options || {};
	if ( !optionsHasStyle( options ) ) {
		options.skeleton = "yMd";
	}
	return Globalize[ runtimeKey( "dateFormatter", this._locale, [ options ] ) ];
};

Globalize.dateToPartsFormatter =
Globalize.prototype.dateToPartsFormatter = function( options ) {
	options = options || {};
	if ( !optionsHasStyle( options ) ) {
		options.skeleton = "yMd";
	}
	return Globalize[ runtimeKey( "dateToPartsFormatter", this._locale, [ options ] ) ];
};

Globalize.dateParser =
Globalize.prototype.dateParser = function( options ) {
	options = options || {};
	if ( !optionsHasStyle( options ) ) {
		options.skeleton = "yMd";
	}
	return Globalize[ runtimeKey( "dateParser", this._locale, [ options ] ) ];
};

Globalize.formatDate =
Globalize.prototype.formatDate = function( value, options ) {
	validateParameterPresence( value, "value" );
	validateParameterTypeDate( value, "value" );

	return this.dateFormatter( options )( value );
};

Globalize.formatDateToParts =
Globalize.prototype.formatDateToParts = function( value, options ) {
	validateParameterPresence( value, "value" );
	validateParameterTypeDate( value, "value" );

	return this.dateToPartsFormatter( options )( value );
};

Globalize.parseDate =
Globalize.prototype.parseDate = function( value, options ) {
	validateParameterPresence( value, "value" );
	validateParameterTypeString( value, "value" );

	return this.dateParser( options )( value );
};

return Globalize;

});
