From c63c59b4080de22b4a871773ac13454ce36cce37 Mon Sep 17 00:00:00 2001 From: Jaiwanth Date: Tue, 1 Jun 2021 21:52:04 +0530 Subject: [PATCH] Rename date function --- src/DateUtils.ts | 2 +- src/utils/exportUtils/HtmlExport.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/DateUtils.ts b/src/DateUtils.ts index 6d390e9132..e629782d6f 100644 --- a/src/DateUtils.ts +++ b/src/DateUtils.ts @@ -138,7 +138,7 @@ export function wantsDateSeparator(prevEventDate: Date, nextEventDate: Date): bo } -export function formatFullDateNoDayNoTime(date: Date) { +export function formatFullDateNoDay(date: Date) { return ( date.getFullYear() + "-" + diff --git a/src/utils/exportUtils/HtmlExport.tsx b/src/utils/exportUtils/HtmlExport.tsx index 0babf01fe7..d5a4220304 100644 --- a/src/utils/exportUtils/HtmlExport.tsx +++ b/src/utils/exportUtils/HtmlExport.tsx @@ -9,7 +9,7 @@ import { Exporter } from "./Exporter"; import { renderToStaticMarkup } from 'react-dom/server' import { Layout } from "../../settings/Layout"; import { shouldFormContinuation } from "../../components/structures/MessagePanel"; -import { formatFullDateNoDayNoTime, wantsDateSeparator } from "../../DateUtils"; +import { formatFullDateNoDay, wantsDateSeparator } from "../../DateUtils"; import { RoomPermalinkCreator } from "../permalinks/Permalinks"; import * as ponyfill from "web-streams-polyfill/ponyfill" import * as Avatar from "../../Avatar"; @@ -205,7 +205,7 @@ export default class HTMLExporter extends Exporter { fileDirectory = "files"; break; } - const fileDate = formatFullDateNoDayNoTime(new Date(event.getTs())); + const fileDate = formatFullDateNoDay(new Date(event.getTs())); const [fileName, fileExt] = this.splitFileName(event.getContent().body); const filePath = fileDirectory + "/" + fileName + '-' + fileDate + '.' + fileExt; return filePath; @@ -283,7 +283,7 @@ export default class HTMLExporter extends Exporter { for (const iconName in exportIcons) { this.zip.file(`icons/${iconName}`, exportIcons[iconName]); } - const filename = `matrix-export-${formatFullDateNoDayNoTime(new Date())}.zip`; + const filename = `matrix-export-${formatFullDateNoDay(new Date())}.zip`; //Generate the zip file asynchronously const blob = await this.zip.generateAsync({ type: "blob" });