mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 20:06:08 +01:00
use note size format also in file properties
This commit is contained in:
@@ -354,6 +354,17 @@ function escapeRegExp(str) {
|
||||
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
|
||||
}
|
||||
|
||||
function formatNoteSize(size) {
|
||||
size = Math.max(Math.round(size / 1024), 1);
|
||||
|
||||
if (size < 1024) {
|
||||
return `${size} KiB`;
|
||||
}
|
||||
else {
|
||||
return `${Math.round(size / 102.4) / 10} MiB`;
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
reloadFrontendApp,
|
||||
parseDate,
|
||||
@@ -396,5 +407,6 @@ export default {
|
||||
filterAttributeName,
|
||||
isValidAttributeName,
|
||||
sleep,
|
||||
escapeRegExp
|
||||
escapeRegExp,
|
||||
formatNoteSize
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user