You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/06/25 00:59:27 UTC
svn commit: r1496279 - in /incubator/climate/trunk/rcmet/src/main/ui:
app/js/app.js config/karma.conf.js
test/unit/filters/ISODateToMiddleEndianTest.js
Author: joyce
Date: Mon Jun 24 22:59:27 2013
New Revision: 1496279
URL: http://svn.apache.org/r1496279
Log:
Resolve CLIMATE-153 - Add filter to convert ISO dates to US dates
- Add filter to convert ISO format date-time stamps to U.S./Middle
Endian date format. Will accept dates-times in the form
YYYY-MM-DDT00:00:00, YYYY-MM-DD 00:00:00, or YYYY-MM-DD.
- Update Karma config to grab the new filters javascript forlder for
testing.
- Add final test to check the filter's handling of dates without any
hyphens in it.
Modified:
incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js
incubator/climate/trunk/rcmet/src/main/ui/config/karma.conf.js
incubator/climate/trunk/rcmet/src/main/ui/test/unit/filters/ISODateToMiddleEndianTest.js
Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js?rev=1496279&r1=1496278&r2=1496279&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js Mon Jun 24 22:59:27 2013
@@ -26,8 +26,9 @@ var App = App || {};
App.Services = angular.module('ocw.services', []);
App.Directives = angular.module('ocw.directives', []);
App.Controllers = angular.module('ocw.controllers', []);
+App.Filters = angular.module('ocw.filters', []);
-angular.module('ocw', ['ocw.services', 'ocw.directives', 'ocw.controllers', 'ui.date']).
+angular.module('ocw', ['ocw.services', 'ocw.directives', 'ocw.controllers', 'ocw.filters', 'ui.date']).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/obs', {templateUrl: 'partials/selectObservation.html', controller: 'ObservationSelectCtrl'}).
Modified: incubator/climate/trunk/rcmet/src/main/ui/config/karma.conf.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/config/karma.conf.js?rev=1496279&r1=1496278&r2=1496279&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/config/karma.conf.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/config/karma.conf.js Mon Jun 24 22:59:27 2013
@@ -33,6 +33,7 @@ files = [
'app/js/controllers/*.js',
'app/js/directives/*.js',
'app/js/services/*.js',
+ 'app/js/filters/*.js',
'test/unit/**/*.js'
];
Modified: incubator/climate/trunk/rcmet/src/main/ui/test/unit/filters/ISODateToMiddleEndianTest.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/test/unit/filters/ISODateToMiddleEndianTest.js?rev=1496279&r1=1496278&r2=1496279&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/test/unit/filters/ISODateToMiddleEndianTest.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/test/unit/filters/ISODateToMiddleEndianTest.js Mon Jun 24 22:59:27 2013
@@ -56,5 +56,12 @@ describe('OCW Filters', function() {
expect(filter('2012-234T234')).toEqual('2012-234T234')
});
});
+
+ it('should do nothing when the date format has no hyphens', function() {
+ inject(function($filter) {
+ var filter = $filter('ISODateToMiddleEndian');
+ expect(filter('2012234T234')).toEqual('2012234T234')
+ });
+ });
});
});