l1xnan / obsidian-better-export-pdf

Obsidian PDF export enhancement plugin
MIT License
240 stars 13 forks source link

Placeholder date format: dd.mm.yy --> dd.mm.yyyy #193

Open merlinuwe opened 2 months ago

merlinuwe commented 2 months ago

I use the placeholder date to make a customized header:

<div style="margin-left: 3em;width: 100vw;font-size:8px;text-align:left;">Wennmann</div>
<div style="margin-right: 3em;width: 100vw;font-size:8px;text-align:right;">
 <span class="date"></span> Uhr
</div>

which gives me that:

image

Is it possible to change the year format from yy to yyyy?

Instead of

01.05.24, 16:24 Uhr

it should be

01.05.2024, 16:24 Uhr

or better

Mittwoch, 01.05.2024, 16:24 Uhr

The best solution for international users would be to support their date formats and make them configurable as they like (moment.js), but for me, it is ok to have the year in 4 digits.

l1xnan commented 2 months ago

<span class="date"></span> rendering results are controlled by the underlying PDF engine, there is no way to modify, but there should be other solutions, such as getting date information from front matter, I experiment first.