Skip to content

Commit

Permalink
refactor remove Date.firstDayOfWeek
Browse files Browse the repository at this point in the history
Supported equivalent is now aria.core.AppEnvironment.firstDayOfWeek
  • Loading branch information
jakub-g committed Mar 21, 2013
1 parent 9259ebc commit 39ec3fe
Show file tree
Hide file tree
Showing 27 changed files with 9 additions and 62 deletions.
1 change: 0 additions & 1 deletion src/aria/resources/DateRes.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Sunday",
"Monday",
Expand Down
3 changes: 1 addition & 2 deletions src/aria/resources/DateRes_cn_CN.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"星期日",
"星期一",
Expand All @@ -45,4 +44,4 @@ Aria.resourcesDefinition({
"十二月"
]
}
});
});
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_da_DK.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"S\u00F8ndag",
"Mandag",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_de_DE.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Sonntag",
"Montag",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_en_GB.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Sunday",
"Monday",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_en_US.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Sunday",
"Monday",
Expand Down
3 changes: 1 addition & 2 deletions src/aria/resources/DateRes_es_ES.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Domingo",
"Lunes",
Expand Down Expand Up @@ -66,4 +65,4 @@ uic.r.shortdate.thu=Ju
uic.r.shortdate.fri=Vi
uic.r.shortdate.sat=S\u00E2
uic.r.shortdate.sun=Do
*/
*/
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_fi_FI.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Sunnuntai",
"Maanantai",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_fr_FR.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 1 /* Monday */,
day : [
"Dimanche",
"Lundi",
Expand Down
3 changes: 1 addition & 2 deletions src/aria/resources/DateRes_is_IS.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"sunnudagur",
"m\u00E1nudagur",
Expand All @@ -45,4 +44,4 @@ Aria.resourcesDefinition({
"desember"
]
}
});
});
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_it_IT.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Domenica",
"Luned\u00EC",
Expand Down
3 changes: 1 addition & 2 deletions src/aria/resources/DateRes_ja_JP.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"日曜日",
"月曜日",
Expand All @@ -45,4 +44,4 @@ Aria.resourcesDefinition({
"十二月"
]
}
});
});
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_ko_KO.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"일요일",
"월요일",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_nl_NL.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"zondag",
"maandag",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_no_NO.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"s\u00F8ndag",
"mandag",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_pl_PL.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Niedziela",
"Poniedzia\u0142ek",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_pt_BR.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Domingo",
"Segunda-feira",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_pt_PT.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Domingo",
"Segunda-feira",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_ru_RU.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Воскресенье",
"Понедельник",
Expand Down
3 changes: 1 addition & 2 deletions src/aria/resources/DateRes_sp_AR.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"الأحد",
"الاثنين",
Expand Down Expand Up @@ -65,4 +64,4 @@ uic.r.shortdate.wed=We
uic.r.shortdate.thu=Th
uic.r.shortdate.fri=Fr
uic.r.shortdate.sat=Sa
uic.r.shortdate.sun=Su*/
uic.r.shortdate.sun=Su*/
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_sv_SE.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"s\u00F6ndag",
"m\u00E5ndag",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_th_TH.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"วันอาทิตย์",
"วันจันทร์",
Expand Down
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_tk_TK.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Pazar",
"Pazartesi",
Expand Down
3 changes: 1 addition & 2 deletions src/aria/resources/DateRes_tr_TR.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"Pazar",
"Pazartesi",
Expand All @@ -45,4 +44,4 @@ Aria.resourcesDefinition({
"Aral\u00FDk"
]
}
});
});
1 change: 0 additions & 1 deletion src/aria/resources/DateRes_tw_TW.js
Expand Up @@ -20,7 +20,6 @@
Aria.resourcesDefinition({
$classpath : 'aria.resources.DateRes',
$resources : {
firstDayOfWeek : 0 /* Sunday */,
day : [
"星期日",
"星期一",
Expand Down
13 changes: 1 addition & 12 deletions src/aria/utils/Date.js
Expand Up @@ -42,17 +42,6 @@ Aria.classDefinition({

var res = this.dateRes, env = this._environment, utilString = aria.utils.String, utilRes = this.res;

// Backward compatibility code to be removed, PTR#05579605 - start.
/**
* Deprecated. Please use aria.core.AppEnvironment.setEnvironment or
* aria.utils.environment.Date.getFirstDayOfWeek to set or retrieve this value. <br />
* First day of the week in the current regional settings (0 = Sunday, ... , 6 = Saturday)
* @type Number
*/
// Take the value which may have already been set in the environment
this.firstDayOfWeek = this._environment.getFirstDayOfWeek();
// Backward compatibility code to be removed, PTR#05579605 - end.

/**
* IATA Months for interpretation
* @protected
Expand Down Expand Up @@ -1775,4 +1764,4 @@ Aria.classDefinition({
return (difference === 0) ? 0 : difference / Math.abs(difference);
}
}
});
});
21 changes: 2 additions & 19 deletions src/aria/utils/environment/Date.js
Expand Up @@ -52,24 +52,7 @@ Aria.classDefinition({
* @return {Integer}
*/
getFirstDayOfWeek : function () {
var firstDayOfWeek = this.checkApplicationSettings("firstDayOfWeek");
// Backward compatibility code to be removed, PTR#05579605 - start.
if (aria.utils.Date) {
firstDayOfWeek = aria.utils.Date.firstDayOfWeek;
}
// Backward compatibility code to be removed, PTR#05579605 - end.
return firstDayOfWeek;
},
/**
* Backward compatibility code to be removed, PTR#05579605 - start. Apply the current environment.
* @param {aria.core.JsObject.Callback} callback Will be called after the environment is applied.
* @override
*/
_applyEnvironment : function (callback) {
if (aria.utils.Date) {
aria.utils.Date.firstDayOfWeek = this.checkApplicationSettings("firstDayOfWeek");
}
this.$callback(callback);
return this.checkApplicationSettings("firstDayOfWeek");
}
}
});
});

0 comments on commit 39ec3fe

Please sign in to comment.