worklist-done

MOE_DEV_NEW_TEMPORARY_DESIGN
Sultan Khan 4 years ago
parent 8587ba279f
commit 5eb2a68831

@ -78,6 +78,15 @@ export class CommonService {
'نوفمبر', 'نوفمبر',
'ديسمبر' 'ديسمبر'
]; ];
public filterKeys = {
'HRSSA': 0,
'INVMOA': 0,
'REQAPPRV': 0,
'POAPPRV': 0,
'INVITEM': 0,
"STAMP": 0,
'ITG': 0
}
private progressLoaders: any[] = []; private progressLoaders: any[] = [];
private loadingProgress: any; private loadingProgress: any;
@ -1571,7 +1580,7 @@ export class CommonService {
public totalCounter = 0; public totalCounter = 0;
getTotalNumberOfWorklistRequest() { getTotalNumberOfWorklistRequest() {
this.totalCounter = parseInt(this.sharedService.getSharedData('total-count')); this.totalCounter = parseInt(this.sharedService.getSharedData('total-count', false));
return this.totalCounter; return this.totalCounter;
} }
setTotalNumberOfWorklistRequest() { setTotalNumberOfWorklistRequest() {
@ -1579,6 +1588,14 @@ export class CommonService {
this.sharedService.setSharedData(this.totalCounter, 'total-count'); this.sharedService.setSharedData(this.totalCounter, 'total-count');
} }
public setFilterValues(data) {
for (const notification of data) {
this.filterKeys[notification.ITEM_TYPE] = notification.OPEN_NTF_NUMBER
}
}
public filters = [ public filters = [
{ {
value: 0, value: 0,
@ -1586,7 +1603,8 @@ export class CommonService {
active: false, active: false,
color: '#18a169', color: '#18a169',
key: 'HRSSA', key: 'HRSSA',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1594,7 +1612,8 @@ export class CommonService {
active: false, active: false,
color: '#3cb9d5', color: '#3cb9d5',
key: 'INVMOA', key: 'INVMOA',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1602,7 +1621,8 @@ export class CommonService {
active: false, active: false,
color: '#114475', color: '#114475',
key: 'REQAPPRV', key: 'REQAPPRV',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1610,7 +1630,8 @@ export class CommonService {
active: false, active: false,
color: '#38c9b3', color: '#38c9b3',
key: 'POAPPRV', key: 'POAPPRV',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1618,7 +1639,8 @@ export class CommonService {
active: false, active: false,
color: '#cc3232', color: '#cc3232',
key: 'ITG', key: 'ITG',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1626,7 +1648,8 @@ export class CommonService {
active: false, active: false,
color: '#9e7e97', color: '#9e7e97',
key: 'INVITEM', key: 'INVITEM',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1634,8 +1657,10 @@ export class CommonService {
active: false, active: false,
color: '#ff9800', color: '#ff9800',
key: 'STAMP', key: 'STAMP',
disable: false disable: false,
} total: 0,
},
]; ];
public data = { public data = {
@ -1655,31 +1680,29 @@ export class CommonService {
}] }]
}; };
assignDataToFilters(result) { getFiltersData() {
const openNotificationsArray = result; // for (const notification of openNotificationsArray) {
// if (notification.ITEM_TYPE === 'HRSSA') {
for (const notification of openNotificationsArray) { this.filters[0].value = this.filterKeys['HRSSA'];
if (notification.ITEM_TYPE === 'HRSSA') { this.data.datasets[0].data[0] = this.filterKeys['HRSSA'];
this.filters[0].value = notification.OPEN_NTF_NUMBER; // } else if (notification.ITEM_TYPE === 'INVMOA') {
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER; this.filters[1].value = this.filterKeys['INVMOA'];
} else if (notification.ITEM_TYPE === 'INVMOA') { this.data.datasets[0].data[1] = this.filterKeys['INVMOA'];
this.filters[1].value = notification.OPEN_NTF_NUMBER; // } else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER; this.filters[2].value = this.filterKeys['REQAPPRV'];
} else if (notification.ITEM_TYPE === 'REQAPPRV') { this.data.datasets[0].data[2] = this.filterKeys['REQAPPRV'];
this.filters[2].value = notification.OPEN_NTF_NUMBER; // } else if (notification.ITEM_TYPE === 'POAPPRV') {
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER; this.filters[3].value = this.filterKeys['POAPPRV'];
} else if (notification.ITEM_TYPE === 'POAPPRV') { this.data.datasets[0].data[3] = this.filterKeys['POAPPRV'];
this.filters[3].value = notification.OPEN_NTF_NUMBER; // } else if (notification.ITEM_TYPE === 'INVITEM') {
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; this.filters[5].value = this.filterKeys['INVITEM'];
} else if (notification.ITEM_TYPE === 'INVITEM') { this.data.datasets[0].data[5] = this.filterKeys['INVITEM'];
this.filters[5].value = notification.OPEN_NTF_NUMBER; // } else if (notification.ITEM_TYPE === 'STAMP') {
this.data.datasets[0].data[5] = notification.OPEN_NTF_NUMBER; this.filters[6].value = this.filterKeys['STAMP'];
} else if (notification.ITEM_TYPE === 'STAMP') { this.data.datasets[0].data[6] = this.filterKeys['STAMP'];
this.filters[6].value = notification.OPEN_NTF_NUMBER;
this.data.datasets[0].data[6] = notification.OPEN_NTF_NUMBER;
} let val = { 'filters': [], 'data': {} };
}
let val = {'filters': [], 'data': {}};
val.filters = this.filters; val.filters = this.filters;
val.data = this.data; val.data = this.data;
return val; return val;

@ -6,6 +6,7 @@ export class MenuResponse {
public static SELECTED_MENU = 'selected_menu'; public static SELECTED_MENU = 'selected_menu';
public static SHARED_SEL_EMP = 'sel_empolyee'; public static SHARED_SEL_EMP = 'sel_empolyee';
public static SHARED_SEL_RESP_ID = 'sel_resp_id'; public static SHARED_SEL_RESP_ID = 'sel_resp_id';
public static ITG_COUNTS = 'itg-counts';
public userid: string; public userid: string;
public search: boolean; public search: boolean;
public List_Menu: ListMenu; public List_Menu: ListMenu;

@ -369,7 +369,12 @@ export class HomePage implements OnInit {
callDashboardServices() { callDashboardServices() {
this.getMenu(); this.getMenu();
this.setServicesPrivilage(); this.setServicesPrivilage();
this.openNotificationsDashbored(); if (this.common.getTotalNumberOfWorklistRequest()) {
this.statsButtons[1].statsValue = this.common.getTotalNumberOfWorklistRequest();
} else {
this.openNotificationsDashbored();
}
this.showOpenMissingSwipes(); this.showOpenMissingSwipes();
this.showAttendanceTracking(); this.showAttendanceTracking();
var accrualBalance = this.common.sharedService.getSharedData('leaveAccrualBalance', false); var accrualBalance = this.common.sharedService.getSharedData('leaveAccrualBalance', false);
@ -660,12 +665,15 @@ export class HomePage implements OnInit {
result, result,
'worklistNotifications' 'worklistNotifications'
); );
this.common.setFilterValues(result['GetOpenNotificationsList']);
} }
}); });
} }
ITGCountAllNotification() { ITGCountAllNotification() {
this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => { this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => {
this.common.sharedService.setSharedData(result, MenuResponse.ITG_COUNTS);
this.common.filterKeys['ITG'] = result.TotalCount;
this.statsButtons[1].statsValue = this.statsButtons[1].statsValue =
Math.floor(this.countAllNotification + result.TotalCount); Math.floor(this.countAllNotification + result.TotalCount);
this.common.stopLoading(); this.common.stopLoading();

@ -11,6 +11,7 @@ import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/wor
import { DatePipe } from '@angular/common'; import { DatePipe } from '@angular/common';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -22,6 +23,7 @@ export class HomeComponent implements OnInit {
public static REQUSET_INFO = 'requset_info'; public static REQUSET_INFO = 'requset_info';
public static ALL_REQUEST = 'all_request'; public static ALL_REQUEST = 'all_request';
public static NOTIFICATION_DATA = 'notification_data'; public static NOTIFICATION_DATA = 'notification_data';
public static COUNT_CHANGED = 'count_changed';
public static NOTIFICATION_ARR = 'notification_arr'; public static NOTIFICATION_ARR = 'notification_arr';
public static NAMES_ALL_iTEMS = 'names-all-items'; public static NAMES_ALL_iTEMS = 'names-all-items';
public static IS_ALL_NAME = 'is_all_names'; public static IS_ALL_NAME = 'is_all_names';
@ -70,7 +72,7 @@ export class HomeComponent implements OnInit {
public showSearchButton = false; public showSearchButton = false;
public itemType = 'HRSSA'; public itemType = 'HRSSA';
public receivedITGCount = false; public receivedITGCount = false;
public countChanged: any = false;
public totalHR = 0; public totalHR = 0;
public totalPO = 0; public totalPO = 0;
public totalPR = 0; public totalPR = 0;
@ -199,12 +201,10 @@ export class HomeComponent implements OnInit {
ionViewWillEnter() { ionViewWillEnter() {
this.totalRequestCount = this.common.getTotalNumberOfWorklistRequest(); this.totalRequestCount = this.common.getTotalNumberOfWorklistRequest();
const values = this.common.assignDataToFilters(this.common.sharedService.getSharedData('worklistNotifications', false)); const values = this.common.getFiltersData();
this.data = values.data; this.data = values.data;
this.filters = values.filters; this.filters = values.filters;
console.log(this.filters);
console.log(this.data);
console.log(this.totalRequestCount);
const loadWorkList = this.common.sharedService.getSharedData('loadWorkList', false); const loadWorkList = this.common.sharedService.getSharedData('loadWorkList', false);
if (loadWorkList) { if (loadWorkList) {
this.receivedITGCount = false; this.receivedITGCount = false;
@ -229,22 +229,34 @@ export class HomeComponent implements OnInit {
} }
callWorkListServices() { callWorkListServices() {
// if (this.countChanged) {
this.Count(); this.Count();
// }
this.getAllPushNotificationFun(); this.getAllPushNotificationFun();
} }
openNotificationsDashboard() { openNotificationsDashboard() {
this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => { // if (this.countChanged) {
if (this.common.validResponse(result)) {
this.worklistNotifications = result; // this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER; // if (this.common.validResponse(result)) {
this.resetFiltersUI(); // this.countChanged = false;
this.assignDataToFilters(); // this.worklistNotifications = result;
this.common.sharedService.setSharedData(result, 'worklistNotifications'); // this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
this.Details(); //this.resetFiltersUI();
this.callWorkListServices(); // this.assignDataToFilters();
} // this.common.sharedService.setSharedData(result, 'worklistNotifications');
}); this.Details();
this.callWorkListServices();
// }
// });
// } else {
// this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
// this.resetFiltersUI();
// this.assignDataToFilters();
// this.Details();
// this.callWorkListServices();
// }
} }
assignDataToFilters() { assignDataToFilters() {
@ -335,7 +347,7 @@ export class HomeComponent implements OnInit {
configureFilters() { configureFilters() {
for (const filter of this.filters) { for (const filter of this.filters) {
if (filter.key === this.itemType) { if (filter.key === this.itemType) {
const index = this.filters.map(function(e) { return e.key; }).indexOf(this.itemType); const index = this.filters.map(function (e) { return e.key; }).indexOf(this.itemType);
this.currentActiveIndex = index; this.currentActiveIndex = index;
this.previousActiveIndex = 0; this.previousActiveIndex = 0;
filter.disable = false; filter.disable = false;
@ -360,13 +372,13 @@ export class HomeComponent implements OnInit {
this.currentActiveIndex = 0; this.currentActiveIndex = 0;
this.previousActiveIndex = 0; this.previousActiveIndex = 0;
for (const filter of this.filters) { for (const filter of this.filters) {
filter.disable = false; filter.disable = false;
if (filter.key === this.itemType) { if (filter.key === this.itemType) {
filter.active = true; filter.active = true;
} else { } else {
filter.active = false; filter.active = false;
}
} }
}
} }
async openSearchModal() { async openSearchModal() {
@ -521,7 +533,7 @@ export class HomeComponent implements OnInit {
} }
} }
public resetFiltersUI () { public resetFiltersUI() {
this.ngZone.run(() => { this.ngZone.run(() => {
this.filters[0].value = 0; this.filters[0].value = 0;
this.filters[1].value = 0; this.filters[1].value = 0;
@ -608,6 +620,7 @@ export class HomeComponent implements OnInit {
.subscribe((result: any) => { .subscribe((result: any) => {
if (result.RequestType) { if (result.RequestType) {
if (result.RequestType.length > 0) { if (result.RequestType.length > 0) {
this.countChanged = false;
this.ITGSegment[0] = { this.ITGSegment[0] = {
name: 'All', name: 'All',
code: 'All', code: 'All',
@ -638,14 +651,30 @@ export class HomeComponent implements OnInit {
} }
Details() { Details() {
this.workListService.getITGDetails('', '', this.isPostNoLoad) // var result = this.common.sharedService.getSharedData(MenuResponse.ITG_COUNTS, false);
.subscribe((result: any) => { // if (this.countChanged) {
this.ITGCount = result.TotalCount; // this.workListService.getITGDetails('', '', this.isPostNoLoad)
this.totalRequestCount = this.totalRequestCount + result.TotalCount; // .subscribe((result: any) => {
this.data.datasets[0].data[4] = this.ITGCount; // this.countChanged = false;
this.filters[4].value = result.TotalCount; // this.ITGCount = result.TotalCount;
this.receivedITGCount = true; // // this.totalRequestCount = this.totalRequestCount + result.TotalCount;
}); // this.data.datasets[0].data[4] = this.ITGCount;
// this.filters[4].value = result.TotalCount;
// this.receivedITGCount = true;
// })
// } else {
//this.workListService.getITGDetails('', '', this.isPostNoLoad)
//.subscribe((result: any) => {
this.ITGCount = this.common.filterKeys['ITG'];//result.TotalCount;
// this.totalRequestCount = this.totalRequestCount + result.TotalCount;
this.data.datasets[0].data[4] = this.common.filterKeys['ITG'];//this.ITGCount;
this.filters[4].value = this.common.filterKeys['ITG'];
this.receivedITGCount = true;
//});
//}
} }
searchBtn() { searchBtn() {

@ -195,6 +195,10 @@ export class WorkListMainItgComponent implements OnInit {
skip() { skip() {
// check if the user clicked on all type of request // check if the user clicked on all type of request
this.common.setTotalNumberOfWorklistRequest();
// this.common.assignDataToFilters(this.common.sharedService.getSharedData('worklistNotifications', false), 'ITG');
if (this.common.filterKeys['ITG'] != 0)
this.common.filterKeys['ITG'] = (this.common.filterKeys['ITG'] - 1)
if (this.is_all_items_sents) { if (this.is_all_items_sents) {
for (let i = 1; i < this.all_request_names.length; i++) { for (let i = 1; i < this.all_request_names.length; i++) {
for (let j = 0; j < this.all_request_names[i].data.length; j++) { for (let j = 0; j < this.all_request_names[i].data.length; j++) {
@ -277,6 +281,7 @@ export class WorkListMainItgComponent implements OnInit {
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; // this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(1); this.confirmMsg(1);
this.skip(); this.skip();
}, 2000); }, 2000);
@ -492,8 +497,8 @@ export class WorkListMainItgComponent implements OnInit {
this.actionService(1, this.commentText); this.actionService(1, this.commentText);
} }
if (this.actionSelected === 'Delegate') { if (this.actionSelected === 'Delegate') {
this.common.sharedService.setSharedData(info,'selectedEmpInfo'), this.common.sharedService.setSharedData(info, 'selectedEmpInfo'),
this.presentModal(4); this.presentModal(4);
} }
if (this.actionSelected === 'Doable') { if (this.actionSelected === 'Doable') {
this.actionService(1, this.commentText); this.actionService(1, this.commentText);
@ -531,9 +536,9 @@ export class WorkListMainItgComponent implements OnInit {
modal.cssClass = 'replaceRoll-modal'; modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
if(data.data.empData){ if (data.data.empData) {
this.replcamentID = data.data.empData.USER_NAME ? data.data.empData.USER_NAME : data.data.empData.EmployeeID; this.replcamentID = data.data.empData.USER_NAME ? data.data.empData.USER_NAME : data.data.empData.EmployeeID;
this.commentText = data.data.comments ? data.data.comments: null; this.commentText = data.data.comments ? data.data.comments : null;
if (actionNumber === 3) { if (actionNumber === 3) {
this.actionService(3, this.commentText); this.actionService(3, this.commentText);
} else if (actionNumber === 4) { } else if (actionNumber === 4) {
@ -564,8 +569,8 @@ export class WorkListMainItgComponent implements OnInit {
returnDateTime(stringDate: string) { returnDateTime(stringDate: string) {
let allDateTime = stringDate.split(' '); let allDateTime = stringDate.split(' ');
let time = allDateTime[1].split(':', 2); let time = allDateTime[1].split(':', 2);
let dateArr= allDateTime[0].split('/') let dateArr = allDateTime[0].split('/')
let correctDate = dateArr[1]+'/'+dateArr[0]+'/'+dateArr[2]; let correctDate = dateArr[1] + '/' + dateArr[0] + '/' + dateArr[2];
let fullDate = this.transform(correctDate); let fullDate = this.transform(correctDate);
return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2]; return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2];
@ -590,7 +595,7 @@ export class WorkListMainItgComponent implements OnInit {
return this.locale[lang].month_names_short[month]; return this.locale[lang].month_names_short[month];
} }
backgroundColor(statusName: string){ backgroundColor(statusName: string) {
// {'bg-blue-txt' : approvalInfo.Action === 'Submit','bg-red-txt': approvalInfo.Action == 'Not Doable' ,'bg-orange-txt' : approvalInfo.Action === 'Pending' ,'bg-red-txt' : approvalInfo.Action === 'Rejected','bg-green-txt' : approvalInfo.Action != 'Pending' && approvalInfo.Action != 'Rejected' && approvalInfo.Action != 'Submit'} // {'bg-blue-txt' : approvalInfo.Action === 'Submit','bg-red-txt': approvalInfo.Action == 'Not Doable' ,'bg-orange-txt' : approvalInfo.Action === 'Pending' ,'bg-red-txt' : approvalInfo.Action === 'Rejected','bg-green-txt' : approvalInfo.Action != 'Pending' && approvalInfo.Action != 'Rejected' && approvalInfo.Action != 'Submit'}
switch (statusName) { switch (statusName) {
case 'Submit': case 'Submit':

@ -430,8 +430,7 @@ export class WorklistMainIcComponent implements OnInit {
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
// this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
}, 5000); }, 5000);
} else { } else {
@ -470,6 +469,9 @@ export class WorklistMainIcComponent implements OnInit {
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequest = this.notificationArray[index].REQUEST_TYPE;
let previousRequestType = this.notificationArray[index].ITEM_TYPE; let previousRequestType = this.notificationArray[index].ITEM_TYPE;
if (this.common.filterKeys[previousRequestType] != 0)
this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1)
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
@ -480,9 +482,11 @@ export class WorklistMainIcComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index); this.checkRequestType(index);
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
@ -1216,9 +1220,9 @@ export class WorklistMainIcComponent implements OnInit {
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 1000);
// this.nextNotfification(); // this.nextNotfification();
} else { } else {
@ -1278,7 +1282,7 @@ export class WorklistMainIcComponent implements OnInit {
this.actionButton(flag); this.actionButton(flag);
} }
returnDateTime(stringDate: string){ returnDateTime(stringDate: string) {
let allDateTime = stringDate.split(' '); let allDateTime = stringDate.split(' ');
let time = allDateTime[1].split(':', 2); let time = allDateTime[1].split(':', 2);
let fullDate = this.transform(stringDate); let fullDate = this.transform(stringDate);
@ -1287,15 +1291,15 @@ export class WorklistMainIcComponent implements OnInit {
} }
locale = { locale = {
en: { en: {
// month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
} }
}; };
transform(value: string) { transform(value: string) {
let x = new Date(Date.parse(value)); let x = new Date(Date.parse(value));
//return value.toLowerCase(); //return value.toLowerCase();
let month = this.getMonthNameShort('en',x.getMonth()) let month = this.getMonthNameShort('en', x.getMonth())
return ""+ x.getDate()+" "+ month +" "+x.getFullYear(); return "" + x.getDate() + " " + month + " " + x.getFullYear();
} }
@ -1303,9 +1307,9 @@ export class WorklistMainIcComponent implements OnInit {
getMonthNameShort(lang,month) { getMonthNameShort(lang, month) {
lang = lang && (lang in this.locale) ? lang : 'en'; lang = lang && (lang in this.locale) ? lang : 'en';
return this.locale[lang].month_names_short[month]; return this.locale[lang].month_names_short[month];
}; };
} }

@ -373,6 +373,7 @@ export class WorklistMainMRComponent implements OnInit {
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; // this.messageSuccess = false;
// this.openNotificationsDashboard(); // this.openNotificationsDashboard();
this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
}, 5000); }, 5000);
} else { } else {
@ -414,7 +415,11 @@ export class WorklistMainMRComponent implements OnInit {
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequest = this.notificationArray[index].REQUEST_TYPE;
let previousRequestType = this.notificationArray[index].ITEM_TYPE; let previousRequestType = this.notificationArray[index].ITEM_TYPE;
if (this.common.filterKeys[previousRequestType] != 0)
this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1)
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
@ -425,9 +430,11 @@ export class WorklistMainMRComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index); this.checkRequestType(index);
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
@ -1117,9 +1124,9 @@ export class WorklistMainMRComponent implements OnInit {
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 1000);
// this.nextNotfification(); // this.nextNotfification();
} else { } else {
@ -1153,7 +1160,7 @@ export class WorklistMainMRComponent implements OnInit {
if (data.data == 'cancel' || data.data == undefined) { if (data.data == 'cancel' || data.data == undefined) {
return; return;
} else if (data.data == 'Success') { } else if (data.data == 'Success') {
// this.openNotificationsDashboard(); this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
} }
@ -1224,7 +1231,7 @@ export class WorklistMainMRComponent implements OnInit {
this.actionButton(flag); this.actionButton(flag);
} }
returnDateTime(stringDate: string){ returnDateTime(stringDate: string) {
let allDateTime = stringDate.split(' '); let allDateTime = stringDate.split(' ');
let time = allDateTime[1].split(':', 2); let time = allDateTime[1].split(':', 2);
let fullDate = this.transform(stringDate); let fullDate = this.transform(stringDate);
@ -1233,15 +1240,15 @@ export class WorklistMainMRComponent implements OnInit {
} }
locale = { locale = {
en: { en: {
// month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
} }
}; };
transform(value: string) { transform(value: string) {
let x = new Date(Date.parse(value)); let x = new Date(Date.parse(value));
//return value.toLowerCase(); //return value.toLowerCase();
let month = this.getMonthNameShort('en',x.getMonth()) let month = this.getMonthNameShort('en', x.getMonth())
return ""+ x.getDate()+" "+ month +" "+x.getFullYear(); return "" + x.getDate() + " " + month + " " + x.getFullYear();
} }
@ -1249,10 +1256,10 @@ export class WorklistMainMRComponent implements OnInit {
getMonthNameShort(lang,month) { getMonthNameShort(lang, month) {
lang = lang && (lang in this.locale) ? lang : 'en'; lang = lang && (lang in this.locale) ? lang : 'en';
return this.locale[lang].month_names_short[month]; return this.locale[lang].month_names_short[month];
}; };
} }

@ -407,8 +407,7 @@ export class WorklistMainPoComponent implements OnInit {
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
// this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
}, 5000); }, 5000);
} else { } else {
@ -446,7 +445,11 @@ export class WorklistMainPoComponent implements OnInit {
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequest = this.notificationArray[index].REQUEST_TYPE;
let previousRequestType = this.notificationArray[index].ITEM_TYPE; let previousRequestType = this.notificationArray[index].ITEM_TYPE;
if (this.common.filterKeys[previousRequestType] != 0)
this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1)
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
@ -457,9 +460,11 @@ export class WorklistMainPoComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index); this.checkRequestType(index);
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
@ -1184,8 +1189,9 @@ export class WorklistMainPoComponent implements OnInit {
} else if (data.data.data === 'Success') { } else if (data.data.data === 'Success') {
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 1000);
} else { } else {
this.common.redToastPK('worklist', 'save-error'); this.common.redToastPK('worklist', 'save-error');
} }
@ -1207,7 +1213,7 @@ export class WorklistMainPoComponent implements OnInit {
console.log(data.data); console.log(data.data);
if (data.data == "cancel" || data.data == undefined) { if (data.data == "cancel" || data.data == undefined) {
return; return;
} else {} } else { }
}); });
return await modal.present(); return await modal.present();
@ -1232,7 +1238,7 @@ export class WorklistMainPoComponent implements OnInit {
this.actionButton(flag); this.actionButton(flag);
} }
returnDateTime(stringDate: string){ returnDateTime(stringDate: string) {
let allDateTime = stringDate.split(' '); let allDateTime = stringDate.split(' ');
let time = allDateTime[1].split(':', 2); let time = allDateTime[1].split(':', 2);
let fullDate = this.transform(stringDate); let fullDate = this.transform(stringDate);
@ -1241,15 +1247,15 @@ export class WorklistMainPoComponent implements OnInit {
} }
locale = { locale = {
en: { en: {
// month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
} }
}; };
transform(value: string) { transform(value: string) {
let x = new Date(Date.parse(value)); let x = new Date(Date.parse(value));
//return value.toLowerCase(); //return value.toLowerCase();
let month = this.getMonthNameShort('en',x.getMonth()) let month = this.getMonthNameShort('en', x.getMonth())
return ""+ x.getDate()+" "+ month +" "+x.getFullYear(); return "" + x.getDate() + " " + month + " " + x.getFullYear();
} }
@ -1257,8 +1263,8 @@ export class WorklistMainPoComponent implements OnInit {
getMonthNameShort(lang,month) { getMonthNameShort(lang, month) {
lang = lang && (lang in this.locale) ? lang : 'en'; lang = lang && (lang in this.locale) ? lang : 'en';
return this.locale[lang].month_names_short[month]; return this.locale[lang].month_names_short[month];
}; };
} }

@ -395,12 +395,7 @@ export class WorklistMainPRComponent implements OnInit {
if (result.MessageStatus == 1) { if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
// show succsfull popup this.common.setTotalNumberOfWorklistRequest();
// this.messageSuccess = true;
// setTimeout(() => {
// this.messageSuccess = false;
// }, 5000);
// this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
} else { } else {
this.common.redToastPK('worklist', 'save-error'); this.common.redToastPK('worklist', 'save-error');
@ -440,9 +435,12 @@ export class WorklistMainPRComponent implements OnInit {
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo); console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index);
console.log(this.notificationArray);
let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequest = this.notificationArray[index].REQUEST_TYPE;
let previousRequestType = this.notificationArray[index].ITEM_TYPE;
if (this.common.filterKeys[previousRequestType] != 0)
this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1)
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
@ -453,9 +451,11 @@ export class WorklistMainPRComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index); this.checkRequestType(index);
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
@ -1117,9 +1117,9 @@ export class WorklistMainPRComponent implements OnInit {
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 1000);
// this.nextNotfification(); // this.nextNotfification();
} else { } else {
@ -1178,7 +1178,7 @@ export class WorklistMainPRComponent implements OnInit {
this.actionButton(flag); this.actionButton(flag);
} }
returnDateTime(stringDate: string){ returnDateTime(stringDate: string) {
let allDateTime = stringDate.split(' '); let allDateTime = stringDate.split(' ');
let time = allDateTime[1].split(':', 2); let time = allDateTime[1].split(':', 2);
let fullDate = this.transform(stringDate); let fullDate = this.transform(stringDate);
@ -1187,15 +1187,15 @@ export class WorklistMainPRComponent implements OnInit {
} }
locale = { locale = {
en: { en: {
// month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
} }
}; };
transform(value: string) { transform(value: string) {
let x = new Date(Date.parse(value)); let x = new Date(Date.parse(value));
//return value.toLowerCase(); //return value.toLowerCase();
let month = this.getMonthNameShort('en',x.getMonth()) let month = this.getMonthNameShort('en', x.getMonth())
return ""+ x.getDate()+" "+ month +" "+x.getFullYear(); return "" + x.getDate() + " " + month + " " + x.getFullYear();
} }
@ -1203,8 +1203,8 @@ export class WorklistMainPRComponent implements OnInit {
getMonthNameShort(lang,month) { getMonthNameShort(lang, month) {
lang = lang && (lang in this.locale) ? lang : 'en'; lang = lang && (lang in this.locale) ? lang : 'en';
return this.locale[lang].month_names_short[month]; return this.locale[lang].month_names_short[month];
}; };
} }

@ -53,8 +53,8 @@ export class WorklistMainComponent implements OnInit {
public static PASS_RES_ATTR = "passResAttr"; public static PASS_RES_ATTR = "passResAttr";
TransactionID: number = -999; TransactionID: number = -999;
notificationBodyRes: any = []; notificationBodyRes: any = [];
stampNsNotificationBodyRes: any =[]; stampNsNotificationBodyRes: any = [];
stampMsNotificationBodyRes: any =[]; stampMsNotificationBodyRes: any = [];
actionHistoryRes: any = []; actionHistoryRes: any = [];
notificationButtonRes: any; notificationButtonRes: any;
actionMode: any; actionMode: any;
@ -436,59 +436,59 @@ export class WorklistMainComponent implements OnInit {
this.notificationBodyRes = this.notificationBodyRes =
result.GetAbsenceCollectionNotificationBodyList; result.GetAbsenceCollectionNotificationBodyList;
} }
} else if (Type === "ADDRESS"){ } else if (Type === "ADDRESS") {
if (result.GetAddressNotificationBodyList) { if (result.GetAddressNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetAddressNotificationBodyList; result.GetAddressNotificationBodyList;
console.log(result); console.log(result);
} }
} else if (Type === "BASIC_DETAILS"){ } else if (Type === "BASIC_DETAILS") {
if (result.GetBasicDetNtfBodyList) { if (result.GetBasicDetNtfBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetBasicDetNtfBodyList; result.GetBasicDetNtfBodyList;
console.log(result); console.log(result);
} }
} else if (Type === "CEI"){ } else if (Type === "CEI") {
if (result.GetCEICollectionNotificationBodyList) { if (result.GetCEICollectionNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetCEICollectionNotificationBodyList[0].Collection_Notification; result.GetCEICollectionNotificationBodyList[0].Collection_Notification;
console.log(result.GetCEICollectionNotificationBodyList[0].Collection_Notification); console.log(result.GetCEICollectionNotificationBodyList[0].Collection_Notification);
} }
} }
else if (Type === "STAMP_MS"){ else if (Type === "STAMP_MS") {
if (result.GetStampMsNotificationBodyList) { if (result.GetStampMsNotificationBodyList) {
this.stampMsNotificationBodyRes = this.stampMsNotificationBodyRes =
result.GetStampMsNotificationBodyList; result.GetStampMsNotificationBodyList;
console.log(result); console.log(result);
} }
} }
else if (Type === "STAMP_NS"){ else if (Type === "STAMP_NS") {
if (result.GetStampNsNotificationBodyList) { if (result.GetStampNsNotificationBodyList) {
this.stampNsNotificationBodyRes = this.stampNsNotificationBodyRes =
result.GetStampNsNotificationBodyList; result.GetStampNsNotificationBodyList;
console.log(result); console.log(result);
} }
} }
else if (Type === "PHONE_NUMBERS"){ else if (Type === "PHONE_NUMBERS") {
if (result.GetPhonesNotificationBodyList) { if (result.GetPhonesNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetPhonesNotificationBodyList; result.GetPhonesNotificationBodyList;
console.log(result); console.log(result);
} }
} }
else if (Type === "TERMINATION"){ else if (Type === "TERMINATION") {
if (result.GetTermNotificationBodyList) { if (result.GetTermNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetTermNotificationBodyList; result.GetTermNotificationBodyList;
console.log(result); console.log(result);
} }
} }
else if (Type === "CONTACT"){ else if (Type === "CONTACT") {
if (result.GetContactNotificationBodyList) { if (result.GetContactNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetContactNotificationBodyList.ContactNotificationBody; result.GetContactNotificationBodyList.ContactNotificationBody;
console.log(result); console.log(result);
} }
} }
} }
} //End handleWorkListBodyResult } //End handleWorkListBodyResult
@ -560,10 +560,9 @@ export class WorklistMainComponent implements OnInit {
// } // }
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
this.common.setTotalNumberOfWorklistRequest();
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
// this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 2000);
} else { } else {
@ -601,14 +600,20 @@ export class WorklistMainComponent implements OnInit {
if (document.getElementById("notificationDynamicFields") != null) { if (document.getElementById("notificationDynamicFields") != null) {
document.getElementById("notificationDynamicFields").innerHTML = ""; document.getElementById("notificationDynamicFields").innerHTML = "";
} }
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo); console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index); console.log(index);
console.log(this.notificationArray); console.log(this.notificationArray);
let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequest = this.notificationArray[index].REQUEST_TYPE;
index += 1; if (previousRequest == 'STAMP_MS' || previousRequest == 'STAMP_NS') {
previousRequest = 'STAMP';
}
if (this.common.filterKeys[previousRequest] != 0)
this.common.filterKeys[previousRequest] = (this.common.filterKeys[previousRequest] - 1)
index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
this.activeSegment = 'info'; this.activeSegment = 'info';
if (this.selectedFilter === 'ALL') { if (this.selectedFilter === 'ALL') {
@ -622,11 +627,15 @@ export class WorklistMainComponent implements OnInit {
this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA); this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA);
this.intializeNotificationDetail(); this.intializeNotificationDetail();
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
} }
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
@ -1019,7 +1028,7 @@ export class WorklistMainComponent implements OnInit {
let jobTitle = title.split('.'); let jobTitle = title.split('.');
if (jobTitle && jobTitle.length > 1) { if (jobTitle && jobTitle.length > 1) {
jobName = jobTitle[0] + " " + jobTitle[1]; jobName = jobTitle[0] + " " + jobTitle[1];
} }
} else { } else {
jobName = ''; jobName = '';
} }
@ -1148,7 +1157,7 @@ export class WorklistMainComponent implements OnInit {
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; // this.messageSuccess = false;
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 1000);
// this.nextNotfification(); // this.nextNotfification();
} else { } else {
this.common.redToastPK('worklist', 'save-error'); this.common.redToastPK('worklist', 'save-error');
@ -1170,6 +1179,7 @@ export class WorklistMainComponent implements OnInit {
return; return;
} else if (data.data == "Success") { } else if (data.data == "Success") {
// this.openNotificationsDashboard(); // this.openNotificationsDashboard();
this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
} }
}); });
@ -1245,7 +1255,7 @@ export class WorklistMainComponent implements OnInit {
console.log(this.arr_hr_req_only); console.log(this.arr_hr_req_only);
} }
returnDateTime(stringDate: string){ returnDateTime(stringDate: string) {
let allDateTime = stringDate.split(' '); let allDateTime = stringDate.split(' ');
let time = allDateTime[1].split(':', 2); let time = allDateTime[1].split(':', 2);
let fullDate = this.transform(stringDate); let fullDate = this.transform(stringDate);
@ -1254,32 +1264,32 @@ export class WorklistMainComponent implements OnInit {
} }
locale = { locale = {
en: { en: {
// month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
} }
}; };
transform(value: string) { transform(value: string) {
let x = new Date(Date.parse(value)); let x = new Date(Date.parse(value));
//return value.toLowerCase(); //return value.toLowerCase();
let month = this.getMonthNameShort('en',x.getMonth()) let month = this.getMonthNameShort('en', x.getMonth())
return ""+ x.getDate()+" "+ month +" "+x.getFullYear(); return "" + x.getDate() + " " + month + " " + x.getFullYear();
} }
getMonthNameShort(lang,month) { getMonthNameShort(lang, month) {
lang = lang && (lang in this.locale) ? lang : 'en'; lang = lang && (lang in this.locale) ? lang : 'en';
return this.locale[lang].month_names_short[month]; return this.locale[lang].month_names_short[month];
} }
showLoading( notificationList ) { showLoading(notificationList) {
if (notificationList.length < 0) { if (notificationList.length < 0) {
return true; return true;
} else if (notificationList === []){ } else if (notificationList === []) {
return false; return false;
} else {return true;} } else { return true; }
} }
} }

Loading…
Cancel
Save