Skip to content

Commit

Permalink
Updated server-connect.service so that default date values are for cu…
Browse files Browse the repository at this point in the history
…rrent data rather than sample date.
  • Loading branch information
Ubuntu committed Feb 19, 2019
1 parent 36dfc98 commit ae76a18
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 61 deletions.
77 changes: 32 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.0",
"@angular/cli": "~7.1.0",
"@angular/compiler-cli": "~7.1.0",
"@angular/compiler-cli": "^7.2.5",
"@angular/language-service": "~7.1.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
Expand Down
30 changes: 15 additions & 15 deletions src/app/services/server-connect.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ export class ServerConnectService {

// ***comment out the following code to test sample orders from sample date 2019 JAN 01...

// this.currYear = `${date.getFullYear()}`;
// let monthNum = date.getMonth();
// let monthConversions = [{'num': 0, 'month': 'JAN'},{'num': 1, 'month': 'FEB'},{'num': 2, 'month': 'MAR'},
// {'num': 3, 'month': 'APR'},{'num': 4, 'month': 'MAY'},{'num': 5, 'month': 'JUN'},
// {'num': 6, 'month': 'JUL'},{'num': 7, 'month': 'AUG'},{'num': 8, 'month': 'SEP'},
// {'num': 9, 'month': 'OCT'},{'num': 10, 'month': 'NOV'},{'num': 11, 'month': 'DEC'}];
// for(let i=0; i<monthConversions.length; i++){
// if(monthNum == monthConversions[i].num){
// this.currMonth = monthConversions[i].month;
// }
// };
// this.currDay = `${date.getDate()}`;
// console.log(`${this.currYear} ${this.currMonth} ${this.currDay}`);

this.currYear = `${date.getFullYear()}`;
let monthNum = date.getMonth();
let monthConversions = [{'num': 0, 'month': 'JAN'},{'num': 1, 'month': 'FEB'},{'num': 2, 'month': 'MAR'},
{'num': 3, 'month': 'APR'},{'num': 4, 'month': 'MAY'},{'num': 5, 'month': 'JUN'},
{'num': 6, 'month': 'JUL'},{'num': 7, 'month': 'AUG'},{'num': 8, 'month': 'SEP'},
{'num': 9, 'month': 'OCT'},{'num': 10, 'month': 'NOV'},{'num': 11, 'month': 'DEC'}];
for(let i=0; i<monthConversions.length; i++){
if(monthNum == monthConversions[i].num){
this.currMonth = monthConversions[i].month;
}
};
this.currDay = `${date.getDate()}`;
console.log(`${this.currYear} ${this.currMonth} ${this.currDay}`);
// ***(end of code to comment out for sample order and date usage)
}

Expand All @@ -59,4 +59,4 @@ export class ServerConnectService {
}
}
}
}
}

0 comments on commit ae76a18

Please sign in to comment.