mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-04 22:00:42 +03:00
Rename date function
This commit is contained in:
parent
01a3b854c3
commit
c63c59b408
2 changed files with 4 additions and 4 deletions
|
@ -138,7 +138,7 @@ export function wantsDateSeparator(prevEventDate: Date, nextEventDate: Date): bo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function formatFullDateNoDayNoTime(date: Date) {
|
export function formatFullDateNoDay(date: Date) {
|
||||||
return (
|
return (
|
||||||
date.getFullYear() +
|
date.getFullYear() +
|
||||||
"-" +
|
"-" +
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { Exporter } from "./Exporter";
|
||||||
import { renderToStaticMarkup } from 'react-dom/server'
|
import { renderToStaticMarkup } from 'react-dom/server'
|
||||||
import { Layout } from "../../settings/Layout";
|
import { Layout } from "../../settings/Layout";
|
||||||
import { shouldFormContinuation } from "../../components/structures/MessagePanel";
|
import { shouldFormContinuation } from "../../components/structures/MessagePanel";
|
||||||
import { formatFullDateNoDayNoTime, wantsDateSeparator } from "../../DateUtils";
|
import { formatFullDateNoDay, wantsDateSeparator } from "../../DateUtils";
|
||||||
import { RoomPermalinkCreator } from "../permalinks/Permalinks";
|
import { RoomPermalinkCreator } from "../permalinks/Permalinks";
|
||||||
import * as ponyfill from "web-streams-polyfill/ponyfill"
|
import * as ponyfill from "web-streams-polyfill/ponyfill"
|
||||||
import * as Avatar from "../../Avatar";
|
import * as Avatar from "../../Avatar";
|
||||||
|
@ -205,7 +205,7 @@ export default class HTMLExporter extends Exporter {
|
||||||
fileDirectory = "files";
|
fileDirectory = "files";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const fileDate = formatFullDateNoDayNoTime(new Date(event.getTs()));
|
const fileDate = formatFullDateNoDay(new Date(event.getTs()));
|
||||||
const [fileName, fileExt] = this.splitFileName(event.getContent().body);
|
const [fileName, fileExt] = this.splitFileName(event.getContent().body);
|
||||||
const filePath = fileDirectory + "/" + fileName + '-' + fileDate + '.' + fileExt;
|
const filePath = fileDirectory + "/" + fileName + '-' + fileDate + '.' + fileExt;
|
||||||
return filePath;
|
return filePath;
|
||||||
|
@ -283,7 +283,7 @@ export default class HTMLExporter extends Exporter {
|
||||||
for (const iconName in exportIcons) {
|
for (const iconName in exportIcons) {
|
||||||
this.zip.file(`icons/${iconName}`, exportIcons[iconName]);
|
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
|
//Generate the zip file asynchronously
|
||||||
const blob = await this.zip.generateAsync({ type: "blob" });
|
const blob = await this.zip.generateAsync({ type: "blob" });
|
||||||
|
|
Loading…
Reference in a new issue