diff --git a/WHOISRESPONSIBLE.txt b/WHOISRESPONSIBLE.txt index 33db0fefcfc..ac6f958ea1b 100644 --- a/WHOISRESPONSIBLE.txt +++ b/WHOISRESPONSIBLE.txt @@ -17,7 +17,6 @@ aura-impl/src/main/resources/aura/controller/ @kgray aura-impl/src/main/resources/aura/error/ @kgray @yungcheng-chen aura-impl/src/main/resources/aura/event/ @kgray aura-impl/src/main/resources/aura/flavors/ @kgray -aura-impl/src/main/resources/aura/l10n/ @kgray aura-impl/src/main/resources/aura/library/ @kgray aura-impl/src/main/resources/aura/method/ @kgray aura-impl/src/main/resources/aura/metrics/ @kgray @mrafique @@ -37,4 +36,4 @@ aura-impl/src/main/resources/aura/modules/ @dval aura-impl/src/main/resources/aura/polyfill/ @dval # Locker Service -aura-impl/src/main/resources/aura/lockerservice/ @jparadis @ravi-jayaramappa \ No newline at end of file +aura-impl/src/main/resources/aura/lockerservice/ @jparadis @ravi-jayaramappa diff --git a/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTest.cmp b/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTest.cmp index 7eb2df353ee..c222fc5129a 100644 --- a/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTest.cmp +++ b/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTest.cmp @@ -26,79 +26,59 @@ - + - -
-
-

Datepicker Show Today Button Tests - showToday=true

-
-
-
Initial Attr
-
showToday: true
-
Run-Time Attr
-
selectedDate: value={!v.selectedDate.value} hours={!v.selectedDate.hours} minutes={!v.selectedDate.minutes}
-
-
- -
-
-
+ +
+
+

Datepicker Show Today Button Tests - showToday=true

+
+
+
Initial Attr
+
showToday: true
+
Run-Time Attr
+
selectedDate: value={!v.selectedDate.value} hours={!v.selectedDate.hours} minutes={!v.selectedDate.minutes}
+
+
+ +
+
+
- -
-
-

Datepicker Show Today Button Tests - showToday=false

-
-
-
Initial Attr
-
showToday: false
-
Run-Time Attr
-
selectedDate: value={!v.selectedDate.value} hours={!v.selectedDate.hours} minutes={!v.selectedDate.minutes}
-
-
- -
-
-
+ +
+
+

Datepicker Show Today Button Tests - showToday=false

+
+
+
Initial Attr
+
showToday: false
+
Run-Time Attr
+
selectedDate: value={!v.selectedDate.value} hours={!v.selectedDate.hours} minutes={!v.selectedDate.minutes}
+
+
+ +
+
+
+ +
+
+

Datepicker Show Today Button Tests -
+ with predefined date - 2015-7-15

+
+
+
Initial Attr
+
showToday: false
+
Run-Time Attr
+
selectedDate: value={!v.selectedDate.value} hours={!v.selectedDate.hours} minutes={!v.selectedDate.minutes}
+
+
+ +
+
+
- -
-
-

Datepicker Show Today Button Tests -
- with predefined date - 2015-7-15

-
-
-
Initial Attr
-
showToday: false
-
Run-Time Attr
-
selectedDate: value={!v.selectedDate.value} hours={!v.selectedDate.hours} minutes={!v.selectedDate.minutes}
-
-
- -
-
-
- - -
-
-

- Datepicker Show Today Button Tests
- {!v.expectedDiffCase} -

-
-
-
Runtime Attr:
-
Time Diff Case: {!v.timeDiffCase}
-
Today Time Full: {!v.todayDate_str}
-
Time Zone 1: {!v.timezone1}
-
todayDate1: {!v.todayDate1}
-
Time Zone 2: {!v.timezone2}
-
todayDate2: {!v.todayDate2}
-
-
-
- \ No newline at end of file + diff --git a/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTestController.js b/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTestController.js index 075f5b48fd9..1647aae4906 100644 --- a/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTestController.js +++ b/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTestController.js @@ -1,13 +1,13 @@ ({ - handleSelectedDate: function(cmp, evt, helper){ - var value = evt.getParam("value"); - var hours = evt.getParam("hours"); - var minutes = evt.getParam("minutes"); + handleSelectedDate: function(cmp, evt, helper) { + var value = evt.getParam("value"); + var hours = evt.getParam("hours"); + var minutes = evt.getParam("minutes"); - cmp.set('v.selectedDate', { - value : value, - hours : hours, - minutes : minutes - }) - } -}) \ No newline at end of file + cmp.set('v.selectedDate', { + value : value, + hours : hours, + minutes : minutes + }) + } +}) diff --git a/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTestTest.js b/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTestTest.js index a38501ec545..421c4f99185 100644 --- a/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTestTest.js +++ b/aura-components/src/test/components/uitest/datePicker_TodayButtonTest/datePicker_TodayButtonTestTest.js @@ -16,12 +16,11 @@ ({ owner:"ctatlah", - CSS_SELECTOR:{ + CSS_SELECTOR: { todayButton : 'span.today', uiDatePicker : '.uiDatePicker' }, - //test to check if the Today Button is visible (showToday=true) //clicking on the today button should populate the datepicker to today date testShowTodayDatepickerFlag: { @@ -113,212 +112,6 @@ ] }, - //test localized service - //SAME YEAR, MONTH, DAY - testLocalizedTodayWithTimezoneAPISameDayMonthYear: { - attributes : {"renderItem" : "testLocalizedTodayWithTimezoneAPI"}, - test: [function(cmp){ - this.setupTimezones(cmp); - }, function(cmp) { - //based on the locale - var self = this; - cmp.set('v.todayDate', new Date('Jul 06 2015 01:26:37 GMT-0700 (PDT)')); - cmp.set('v.todayDate_str', cmp.get('v.todayDate').toString()); - cmp.set('v.expectedDiffCase', 'SAME YEAR, MONTH, DAY'); - }, function(cmp){ - //based on the locale - var self = this; - - $A.localizationService.getDateStringBasedOnTimezone( - cmp.get('v.timezone1'), - cmp.get('v.todayDate'), - function(dateString) { - cmp.set('v.todayDate1', dateString); - self.verifyValidDateString( dateString); - } - ); - - $A.localizationService.getDateStringBasedOnTimezone( - cmp.get('v.timezone2'), - cmp.get('v.todayDate'), - function(dateString) { - cmp.set('v.todayDate2', dateString); - self.verifyValidDateString( dateString); - } - ); - }, function(cmp){ - var self = this; - - $A.test.addWaitForWithFailureMessage( - true, - function(){//testFunction - return cmp.get('v.todayDate1') && cmp.get('v.todayDate2') && - cmp.get('v.todayDate1').length > 0 && cmp.get('v.todayDate2').length > 0; - }, - 'today Dates should have been initialized',//failureMessage - function(){//callback - self.verifyDateOffset( cmp.get('v.todayDate1'), cmp.get('v.todayDate2'), cmp); - } - ); - }] - }, - - - - //test localized service - //NEXT DAY SAME MONTH - testLocalizedTodayWithTimezoneAPINextDaySameMonth: { - attributes : {"renderItem" : "testLocalizedTodayWithTimezoneAPI"}, - test: [function(cmp){ - this.setupTimezones(cmp); - }, function(cmp) { - //based on the locale - var self = this; - cmp.set('v.todayDate', new Date('Jul 06 2015 21:26:37 GMT-0700 (PDT)')); - cmp.set('v.todayDate_str', cmp.get('v.todayDate').toString()); - cmp.set('v.expectedDiffCase', 'NEXT DAY SAME MONTH'); - }, function(cmp){ - //based on the locale - var self = this; - - $A.localizationService.getDateStringBasedOnTimezone( - cmp.get('v.timezone1'), - cmp.get('v.todayDate'), - function(dateString) { - cmp.set('v.todayDate1', dateString); - self.verifyValidDateString( dateString); - } - ); - - $A.localizationService.getDateStringBasedOnTimezone( - cmp.get('v.timezone2'), - cmp.get('v.todayDate'), - function(dateString) { - cmp.set('v.todayDate2', dateString); - self.verifyValidDateString( dateString); - } - ); - }, function(cmp){ - var self = this; - - $A.test.addWaitForWithFailureMessage( - true, - function(){//testFunction - return cmp.get('v.todayDate1') && cmp.get('v.todayDate2') && - cmp.get('v.todayDate1').length > 0 && cmp.get('v.todayDate2').length > 0; - }, - 'today Dates should have been initialized',//failureMessage - function(){//callback - self.verifyDateOffset( cmp.get('v.todayDate1'), cmp.get('v.todayDate2'), cmp); - } - ); - }] - }, - - - - //test localized service - //FIRST DAY NEXT MONTH - testLocalizedTodayWithTimezoneAPIFirstDayNextMonth: { - attributes : {"renderItem" : "testLocalizedTodayWithTimezoneAPI"}, - test: [function(cmp){ - this.setupTimezones(cmp); - }, function(cmp) { - //based on the locale - var self = this; - cmp.set('v.todayDate', new Date('Jul 31 2015 21:26:37 GMT-0700 (PDT)')); - cmp.set('v.todayDate_str', cmp.get('v.todayDate').toString()); - cmp.set('v.expectedDiffCase', 'FIRST DAY NEXT MONTH'); - }, function(cmp){ - //based on the locale - var self = this; - - $A.localizationService.getDateStringBasedOnTimezone( - cmp.get('v.timezone1'), - cmp.get('v.todayDate'), - function(dateString) { - cmp.set('v.todayDate1', dateString); - self.verifyValidDateString( dateString); - } - ); - - $A.localizationService.getDateStringBasedOnTimezone( - cmp.get('v.timezone2'), - cmp.get('v.todayDate'), - function(dateString) { - cmp.set('v.todayDate2', dateString); - self.verifyValidDateString( dateString); - } - ); - }, function(cmp){ - var self = this; - - $A.test.addWaitForWithFailureMessage( - true, - function(){//testFunction - return cmp.get('v.todayDate1') && cmp.get('v.todayDate2') && - cmp.get('v.todayDate1').length > 0 && cmp.get('v.todayDate2').length > 0; - }, - 'today Dates should have been initialized',//failureMessage - function(){//callback - self.verifyDateOffset( cmp.get('v.todayDate1'), cmp.get('v.todayDate2'), cmp); - } - ); - }] - }, - - - //test localized service - //FIRST DAY NEXT YEAR - testLocalizedTodayWithTimezoneAPIFirstDayNextYear: { - attributes : {"renderItem" : "testLocalizedTodayWithTimezoneAPI"}, - test: [function(cmp){ - this.setupTimezones(cmp); - }, function(cmp) { - //based on the locale - var self = this; - cmp.set('v.todayDate', new Date('Dec 31 2015 21:26:37 GMT-0700 (PDT)')); - cmp.set('v.todayDate_str', cmp.get('v.todayDate').toString()); - cmp.set('v.expectedDiffCase', 'FIRST DAY NEXT YEAR'); - }, function(cmp){ - //based on the locale - var self = this; - - $A.localizationService.getDateStringBasedOnTimezone( - cmp.get('v.timezone1'), - cmp.get('v.todayDate'), - function(dateString) { - cmp.set('v.todayDate1', dateString); - self.verifyValidDateString( dateString); - } - ); - - $A.localizationService.getDateStringBasedOnTimezone( - cmp.get('v.timezone2'), - cmp.get('v.todayDate'), - function(dateString) { - cmp.set('v.todayDate2', dateString); - self.verifyValidDateString( dateString); - } - ); - }, function(cmp){ - var self = this; - - $A.test.addWaitForWithFailureMessage( - true, - function(){//testFunction - return cmp.get('v.todayDate1') && cmp.get('v.todayDate2') && - cmp.get('v.todayDate1').length > 0 && cmp.get('v.todayDate2').length > 0; - }, - 'today Dates should have been initialized',//failureMessage - function(){//callback - self.verifyDateOffset( cmp.get('v.todayDate1'), cmp.get('v.todayDate2'), cmp); - } - ); - }] - }, - - //helper //verify if an element el contains css class name verifyContainClass: function(el, cssClassName){ @@ -407,62 +200,6 @@ }; }, - - //verify date offset - verifyDateOffset: function(todayDateString1, todayDateString2, cmp){ - var self = this; - - var todayDateObj1 = self.verifyValidDateString( todayDateString1 ); - var todayDateObj2 = self.verifyValidDateString( todayDateString2 ); - - if (todayDateObj1.day !== todayDateObj2.day){ - //timezone provides different dates, needs further date - - if (todayDateObj1.day < todayDateObj2.day){ - //next day same month - cmp.set('v.timeDiffCase', 'NEXT DAY SAME MONTH: todayDate2.day = todayDate1.day + 1'); - $A.test.assertTrue( - todayDateObj2.day - 1 === todayDateObj1.day, - 'NEXT DAY SAME MONTH: todayDate2.day = todayDate1.day + 1' - ); - } - else if (todayDateObj1.month < todayDateObj2.month){ - //first day next month - cmp.set('v.timeDiffCase', 'FIRST DAY NEXT MONTH: todayDate2.month = todayDate1.month + 1'); - $A.test.assertTrue( - todayDateObj2.month - 1 === todayDateObj1.month, - 'FIRST DAY NEXT MONTH: todayDate2.month = todayDate1.month + 1' - ); - } - else{ - //next year first day first month - cmp.set('v.timeDiffCase', 'FIRST DAY NEXT YEAR: todayDate2.year = todayDate1.year + 1'); - $A.test.assertTrue( - todayDateObj2.year - 1 === todayDateObj1.year, - 'FIRST DAY NEXT YEAR: todayDate2.year = todayDate1.year + 1' - ); - } - } - else{ - cmp.set('v.timeDiffCase', 'SAME DAY, MONTH, YEAR, offset is minor'); - $A.test.assertEquals( - todayDateObj1.day, - todayDateObj2.day, - 'SAME DAY, MONTH, YEAR : day should match' - ); - $A.test.assertEquals( - todayDateObj1.month, - todayDateObj2.month, - 'SAME DAY, MONTH, YEAR : month should match' - ); - $A.test.assertEquals( - todayDateObj1.year, - todayDateObj2.year, - 'SAME DAY, MONTH, YEAR : year should match' - ); - } - }, - verifyDatepickerTodayAttr: function(cmp, expectedDay, expectedMonth_StartFromZero, expectedYear){ var datepickerCmp = cmp.find('datePicker'); var todayStr = datepickerCmp.find("grid").get('v._today');//yyyy-MM-dd @@ -483,12 +220,5 @@ datepickerCmp.find('grid').get("v.year"), 'YEAR Val must match. Found : ' + todayStr ); - }, - - - //set up timezones - setupTimezones: function(cmp){ - cmp.set('v.timezone1', 'America/Los_Angeles'); - cmp.set('v.timezone2', 'Asia/Bankok'); } }) diff --git a/aura-impl/src/main/resources/aura/Aura.js b/aura-impl/src/main/resources/aura/Aura.js index 9dcb6a1a387..bc983341c29 100644 --- a/aura-impl/src/main/resources/aura/Aura.js +++ b/aura-impl/src/main/resources/aura/Aura.js @@ -213,9 +213,6 @@ function noop() {} // #include aura.requiredVersion.RequiredVersionDef // #include aura.requiredVersion.RequiredVersionDefSet -// -- L10n --------------------------------------------------------------- -// #include aura.l10n.AuraLocalizationContext - // -- Storage ------------------------------------------------------------- // #include aura.storage.AuraStorageService // #include aura.storage.AuraStorage diff --git a/aura-impl/src/main/resources/aura/AuraInstance.js b/aura-impl/src/main/resources/aura/AuraInstance.js index c0da7d1efb5..b2d7672d481 100644 --- a/aura-impl/src/main/resources/aura/AuraInstance.js +++ b/aura-impl/src/main/resources/aura/AuraInstance.js @@ -141,15 +141,6 @@ function AuraInstance () { */ history : this.historyService, - /** - * Localization Service - * - * @public - * @type AuraLocalizationService - * @memberOf AuraInstance.prototype - */ - localization : this.localizationService, - /** * Storage Service * @@ -179,16 +170,6 @@ function AuraInstance () { */ e : this.eventService, - /** - * Alias of Localization Service - * - * @public - * @type AuraLocalizationService - * @memberOf AuraInstance.prototype - * @see Aura#service.localization - */ - l10n : this.localizationService, - /** * Style Service * @@ -378,7 +359,6 @@ function AuraInstance () { services["component"] = services.component; services["client"] = services.client; services["history"] = services.history; - services["l10n"] = services.localization; services["storage"] = services.storage; services["metrics"] = services.metrics; services["cmp"] = services.cmp; diff --git a/aura-impl/src/main/resources/aura/l10n/AuraLocalizationContext.js b/aura-impl/src/main/resources/aura/l10n/AuraLocalizationContext.js deleted file mode 100644 index 4694445556c..00000000000 --- a/aura-impl/src/main/resources/aura/l10n/AuraLocalizationContext.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2013 salesforce.com, inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @public - * @class - * @constructor - */ -// FIXME: AuraLocalizationContext should become a global value provider and be accessed via the expression service. -function AuraLocalizationContext(config) { - this.dateFormat = config.dateFormat; -} - -Aura.L10n.AuraLocalizationContext = AuraLocalizationContext; \ No newline at end of file