Skip to content

Instantly share code, notes, and snippets.

@Matheus-de-Souza
Created April 5, 2016 18:29
Show Gist options
  • Save Matheus-de-Souza/63b57420c60821253bed444fe6d9cbf9 to your computer and use it in GitHub Desktop.
Save Matheus-de-Souza/63b57420c60821253bed444fe6d9cbf9 to your computer and use it in GitHub Desktop.
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