Skip to content

Commit 4a48fd4

Browse files
fixed report display header time
1 parent a20b3e9 commit 4a48fd4

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/pdf/pdf-parts/drawHeaderAndSignatureBoxes.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import moment from 'moment';
12
import { TableColorRange } from '../interfaces/TableColorRange';
23
import { drawSignatureBoxes } from './drawSignatureBoxes';
34

@@ -220,11 +221,12 @@ function calculateStatsRows(data, tableColorRange) {
220221
* Format a Date as "YYYY-MM-DD HH:mm"
221222
*/
222223
function formatDateForRange(date) {
223-
const yyyy = date.getFullYear();
224-
const MM = String(date.getMonth() + 1).padStart(2, '0');
225-
const dd = String(date.getDate()).padStart(2, '0');
226-
const hh = String(date.getHours()).padStart(2, '0');
227-
const mm = String(date.getMinutes()).padStart(2, '0');
224+
const dateToDisplay = moment(date).tz('Asia/Tokyo').toDate();
225+
const yyyy = dateToDisplay.getFullYear();
226+
const MM = String(dateToDisplay.getMonth() + 1).padStart(2, '0');
227+
const dd = String(dateToDisplay.getDate()).padStart(2, '0');
228+
const hh = String(dateToDisplay.getHours()).padStart(2, '0');
229+
const mm = String(dateToDisplay.getMinutes()).padStart(2, '0');
228230
return `${yyyy}-${MM}-${dd} ${hh}:${mm}`;
229231
}
230232

0 commit comments

Comments
 (0)