perbaikan tanggal UCT
This commit is contained in:
parent
5afb289070
commit
123c39e5a2
|
@ -13,7 +13,7 @@
|
||||||
href="https://allbestsistem.com/"
|
href="https://allbestsistem.com/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
style="background-color: #000000 !important;"
|
style="background-color: #000000 !important;"
|
||||||
>Smart Building Management Systems (V@2024-06-1.01)
|
>Smart Building Management Systems (V@2024-07-1.01)
|
||||||
</a></span
|
</a></span
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -172,6 +172,7 @@ export class TableexcelService {
|
||||||
|
|
||||||
const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(filteredJson);
|
const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(filteredJson);
|
||||||
const columnWidths = [
|
const columnWidths = [
|
||||||
|
{ wch: 30 },
|
||||||
{ wch: 40 },
|
{ wch: 40 },
|
||||||
{ wch: 30 },
|
{ wch: 30 },
|
||||||
{ wch: 30 },
|
{ wch: 30 },
|
||||||
|
@ -180,11 +181,11 @@ export class TableexcelService {
|
||||||
{ wch: 20 },
|
{ wch: 20 },
|
||||||
{ wch: 20 },
|
{ wch: 20 },
|
||||||
{ wch: 20 },
|
{ wch: 20 },
|
||||||
{ wch: 30 },
|
|
||||||
];
|
];
|
||||||
worksheet["!cols"] = columnWidths;
|
worksheet["!cols"] = columnWidths;
|
||||||
|
|
||||||
const header = [
|
const header = [
|
||||||
|
"Periode",
|
||||||
"Device",
|
"Device",
|
||||||
"Room",
|
"Room",
|
||||||
"Category",
|
"Category",
|
||||||
|
@ -193,7 +194,6 @@ export class TableexcelService {
|
||||||
"Watt",
|
"Watt",
|
||||||
"Duration",
|
"Duration",
|
||||||
"Price Kwh",
|
"Price Kwh",
|
||||||
"Periode",
|
|
||||||
];
|
];
|
||||||
XLSX.utils.sheet_add_aoa(worksheet, [header]);
|
XLSX.utils.sheet_add_aoa(worksheet, [header]);
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,16 @@
|
||||||
</p>
|
</p>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ngx-datatable-column>
|
</ngx-datatable-column>
|
||||||
|
<ngx-datatable-column name="periode" [flexGrow]="1" [minWidth]="90">
|
||||||
|
<ng-template ngx-datatable-header-template>
|
||||||
|
<span style="color: #ffffff !important">Tanggal</span>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template let-value="value" ngx-datatable-cell-template>
|
||||||
|
<p style="color: #ffffff !important">
|
||||||
|
{{ value | date : "dd/MM/yyyy" }}
|
||||||
|
</p>
|
||||||
|
</ng-template>
|
||||||
|
</ngx-datatable-column>
|
||||||
<ngx-datatable-column name="deviceName" [flexGrow]="1" [minWidth]="90">
|
<ngx-datatable-column name="deviceName" [flexGrow]="1" [minWidth]="90">
|
||||||
<ng-template ngx-datatable-header-template>
|
<ng-template ngx-datatable-header-template>
|
||||||
<span style="color: #ffffff !important">Device</span>
|
<span style="color: #ffffff !important">Device</span>
|
||||||
|
@ -106,16 +116,6 @@
|
||||||
</p>
|
</p>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ngx-datatable-column>
|
</ngx-datatable-column>
|
||||||
<ngx-datatable-column name="periode" [flexGrow]="1" [minWidth]="90">
|
|
||||||
<ng-template ngx-datatable-header-template>
|
|
||||||
<span style="color: #ffffff !important">Tanggal</span>
|
|
||||||
</ng-template>
|
|
||||||
<ng-template let-value="value" ngx-datatable-cell-template>
|
|
||||||
<p style="color: #ffffff !important">
|
|
||||||
{{ value | date : "dd/MM/yyyy" }}
|
|
||||||
</p>
|
|
||||||
</ng-template>
|
|
||||||
</ngx-datatable-column>
|
|
||||||
</ngx-datatable>
|
</ngx-datatable>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,7 +28,8 @@ export class ModalExportComponent {
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.formattedEndDate = this.dataRow.endDate.slice(0, 7);
|
const dateRow = this.convertToUTC7(this.dataRow.endDate)
|
||||||
|
this.formattedEndDate = dateRow.slice(0, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
|
@ -45,6 +46,7 @@ export class ModalExportComponent {
|
||||||
.getCostDetail(category, room, period)
|
.getCostDetail(category, room, period)
|
||||||
.subscribe((response) => {
|
.subscribe((response) => {
|
||||||
this.dataExport = response.data;
|
this.dataExport = response.data;
|
||||||
|
console.log(this.dataExport);
|
||||||
this.data_cost = response.data.map((item) => ({
|
this.data_cost = response.data.map((item) => ({
|
||||||
deviceName: item.device_name,
|
deviceName: item.device_name,
|
||||||
roomName: item.room_name,
|
roomName: item.room_name,
|
||||||
|
@ -54,27 +56,39 @@ export class ModalExportComponent {
|
||||||
watt: item.watt,
|
watt: item.watt,
|
||||||
duration: item.duration,
|
duration: item.duration,
|
||||||
priceKwh: item.price_kwh,
|
priceKwh: item.price_kwh,
|
||||||
periode: item.periode,
|
// periode: item.periode,
|
||||||
|
periode: this.convertToUTC7(item.periode)
|
||||||
}));
|
}));
|
||||||
|
console.log(this.data_cost);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
convertToUTC7(dateString: string): string {
|
||||||
|
const date = new Date(dateString);
|
||||||
|
const utc7Offset = 7 * 60; // UTC+7 in minutes
|
||||||
|
const localOffset = date.getTimezoneOffset();
|
||||||
|
const totalOffset = utc7Offset - localOffset;
|
||||||
|
const utc7Date = new Date(date.getTime() + totalOffset * 60 * 1000);
|
||||||
|
return utc7Date.toISOString();
|
||||||
|
}
|
||||||
|
|
||||||
export() {
|
export() {
|
||||||
this.spinnerExportActive = true;
|
this.spinnerExportActive = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const columnsToExport = [
|
const columnsToExport = [
|
||||||
"device_name",
|
"periode",
|
||||||
"room_name",
|
"deviceName",
|
||||||
"category_name",
|
"roomName",
|
||||||
"estimation_cost",
|
"categoryName",
|
||||||
"total_kwh",
|
"estimationCost",
|
||||||
|
"totalKwh",
|
||||||
"watt",
|
"watt",
|
||||||
"duration",
|
"duration",
|
||||||
"price_kwh",
|
"priceKwh",
|
||||||
"periode",
|
|
||||||
];
|
];
|
||||||
this.tableexcelService.exportAsExcelFileManageDetail(
|
this.tableexcelService.exportAsExcelFileManageDetail(
|
||||||
this.dataExport,
|
this.data_cost,
|
||||||
"export_detail_cost_management",
|
"export_detail_cost_management",
|
||||||
columnsToExport
|
columnsToExport
|
||||||
);
|
);
|
||||||
|
|
|
@ -138,7 +138,7 @@
|
||||||
<p
|
<p
|
||||||
class="card-subtitle line-on-side text-muted text-center font-small-3 mx-2 my-1"
|
class="card-subtitle line-on-side text-muted text-center font-small-3 mx-2 my-1"
|
||||||
>
|
>
|
||||||
<span>(v@2024.06.1.01)</span>
|
<span>(v@2024.07.1.01)</span>
|
||||||
</p>
|
</p>
|
||||||
<!-- <div class="card-body">
|
<!-- <div class="card-body">
|
||||||
<a
|
<a
|
||||||
|
|
Loading…
Reference in New Issue