You've already forked openaccounting-web
mirror of
https://github.com/openaccounting/oa-web.git
synced 2025-12-09 09:01:24 +13:00
use timezone everywhere
This commit is contained in:
@@ -44,10 +44,16 @@ export class IncomeReport {
|
||||
private orgService: OrgService,
|
||||
private configService: ConfigService,
|
||||
private sessionService: SessionService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.sessionService.setLoading(true);
|
||||
this.org = this.orgService.getCurrentOrg();
|
||||
|
||||
this.startDate = new Date();
|
||||
Util.setFirstOfMonth(this.startDate);
|
||||
Util.setBeginOfDay(this.startDate);
|
||||
this.endDate = Util.getOneMonthLater(this.startDate);
|
||||
Util.setFirstOfMonth(this.startDate, this.org.timezone);
|
||||
Util.setBeginOfDay(this.startDate, this.org.timezone);
|
||||
this.endDate = Util.getOneMonthLater(this.startDate, this.org.timezone);
|
||||
|
||||
let reportData = this.configService.get('reportData');
|
||||
|
||||
@@ -62,15 +68,10 @@ export class IncomeReport {
|
||||
}
|
||||
}
|
||||
|
||||
this.form = fb.group({
|
||||
startDate: [Util.getLocalDateString(this.startDate), Validators.required],
|
||||
endDate: [Util.getLocalDateStringExcl(this.endDate), Validators.required]
|
||||
this.form = this.fb.group({
|
||||
startDate: [Util.getLocalDateString(this.startDate, this.org.timezone), Validators.required],
|
||||
endDate: [Util.getLocalDateStringExcl(this.endDate, this.org.timezone), Validators.required]
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.sessionService.setLoading(true);
|
||||
this.org = this.orgService.getCurrentOrg();
|
||||
|
||||
this.treeSubscription = this.accountService.getAccountTreeWithPeriodBalance(this.startDate, this.endDate)
|
||||
.subscribe(tree => {
|
||||
@@ -90,8 +91,8 @@ export class IncomeReport {
|
||||
this.treeSubscription.unsubscribe();
|
||||
//this.dataService.setLoading(true);
|
||||
this.showDateForm = false;
|
||||
this.startDate = Util.getDateFromLocalDateString(this.form.value.startDate);
|
||||
this.endDate = Util.getDateFromLocalDateStringExcl(this.form.value.endDate);
|
||||
this.startDate = Util.getDateFromLocalDateString(this.form.value.startDate, this.org.timezone);
|
||||
this.endDate = Util.getDateFromLocalDateStringExcl(this.form.value.endDate, this.org.timezone);
|
||||
|
||||
let reportData = this.configService.get('reportData');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user