You've already forked openaccounting-web
mirror of
https://github.com/openaccounting/oa-web.git
synced 2025-12-09 09:01:24 +13:00
separate out date functions
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
ValidationErrors
|
||||
} from '@angular/forms';
|
||||
import { AppError } from '../shared/error';
|
||||
import { Util } from '../shared/util';
|
||||
import { DateUtil } from '../shared/dateutil';
|
||||
|
||||
@Component({
|
||||
selector: 'app-income',
|
||||
@@ -51,9 +51,9 @@ export class IncomeReport {
|
||||
this.org = this.orgService.getCurrentOrg();
|
||||
|
||||
this.startDate = new Date();
|
||||
Util.setFirstOfMonth(this.startDate, this.org.timezone);
|
||||
Util.setBeginOfDay(this.startDate, this.org.timezone);
|
||||
this.endDate = Util.getOneMonthLater(this.startDate, this.org.timezone);
|
||||
DateUtil.setFirstOfMonth(this.startDate, this.org.timezone);
|
||||
DateUtil.setBeginOfDay(this.startDate, this.org.timezone);
|
||||
this.endDate = DateUtil.getOneMonthLater(this.startDate, this.org.timezone);
|
||||
|
||||
let reportData = this.configService.get('reportData');
|
||||
|
||||
@@ -69,8 +69,8 @@ export class IncomeReport {
|
||||
}
|
||||
|
||||
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]
|
||||
startDate: [DateUtil.getLocalDateString(this.startDate, this.org.timezone), Validators.required],
|
||||
endDate: [DateUtil.getLocalDateStringExcl(this.endDate, this.org.timezone), Validators.required]
|
||||
});
|
||||
|
||||
this.treeSubscription = this.accountService.getAccountTreeWithPeriodBalance(this.startDate, this.endDate)
|
||||
@@ -91,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.org.timezone);
|
||||
this.endDate = Util.getDateFromLocalDateStringExcl(this.form.value.endDate, this.org.timezone);
|
||||
this.startDate = DateUtil.getDateFromLocalDateString(this.form.value.startDate, this.org.timezone);
|
||||
this.endDate = DateUtil.getDateFromLocalDateStringExcl(this.form.value.endDate, this.org.timezone);
|
||||
|
||||
let reportData = this.configService.get('reportData');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user