Created
April 5, 2016 18:29
-
-
Save Matheus-de-Souza/63b57420c60821253bed444fe6d9cbf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app.filters', []) | |
.filter('fixDate', fixDate) | |
fixDate.$inject = ['$rootScope','globalConfig']; | |
function fixDate ($rootScope, globalConfig) { | |
return function (strDate) { | |
if (!$rootScope.isWebDebug() && | |
globalConfig.app.platform === "I") { | |
// Apply each element to the Date function | |
return new Date(strDate.replace(/-/g, '/')); | |
} else { | |
return new Date(strDate); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment