Could anyone help me with date formatting? I am facing an issue with the date format in a table within my application. The current date format is not correct and appears as shown on the screen. I would like to format it to YYYY-MM-DD only. Any suggestions or advice?
View the screen from the console
appManagementProjects.js
(function() {
'use strict';
angular
.module('appManagementProjects', [
'ngMaterial'
])
.controller('ManagementProjectsCtrl', ManagementProjectsCtrl);
function ManagementProjectsCtrl(serviceManagementDataTable, serviceManagementProjects, $mdDialog, $mdToast) {
var vm = this;
// more code here...
}
})();
serviceManagementProjects.js
(function() {
'use strict';
angular
.module('appManagementProjects')
.factory('serviceManagementProjects', ServiceManagementProjects);
function ServiceManagementProjects($resource) {
var data = [];
// more code here...
}
})();
addDataProject.html
<md-dialog class="md-default-theme addProjectForm">
<md-dialog-content>
<h2 class="md-title">Adding a new project</h2>
<form name="addProject" onclick="return false;">
// form fields here...
</form>
</md-dialog-content>
<div class="md-actions">
// buttons here...
</div>
editDataProject.html
<md-dialog class="md-default-theme addProjectForm">
<md-dialog-content>
<h2 class="md-title">Editing a project</h2>
<form name="editProject" onclick="return false;">
// form fields here...
</form>
</md-dialog-content>
<div class="md-actions">
// buttons here...
</div>
managementProjects.html
<div management-data-table datatable="managementProjects.dtData" columnstable="managementProjects.dtColumns" config="managementProjects.config"></div>
datatable directive
(function() {
'use strict';
angular
.module('appManagementDataTable')
.directive('managementDataTable', ManagementDataTable);
function ManagementDataTable($mdDialog) {
return {
// directive content here...
}
}
})();