-
-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change date format in header #210
Comments
+1 for this request - or at least use the default locale, or allow to specify ISO 8601 (as @drrhf suggests). As far as I can see it's fixed to the US format, and that's really only useful in the US! ;) Thanks |
+1 from my side. ps: I really appreciate your extension :) |
+1 from me to customise the date in settings or default to local PC settings. Thanks |
Please add either UK or Swedish date format as an option, thanks! :) |
If anything, ISO 8601 should be the default format (and every sane MD author should use it when creating any document). Other proprietary regional formats should be considered optional. |
Ok, that one really annoyed me. After quite some digging I still can't work around this issue properly. What a pity. But at least I can share what I tried and what actually works. tl;dr: Details: var options = {
executablePath: vscode.workspace.getConfiguration('markdown-pdf')['executablePath'] || puppeteer.executablePath(),
args: ['--lang='+vscode.env.language, '--no-sandbox', '--disable-setuid-sandbox']
// Setting Up Chrome Linux Sandbox
// https://github.com/puppeteer/puppeteer/blob/master
}; What we are looking for is Since this extension allows to use an a chromium installation provided somewhere else, another road to success could be to configure Although this looked promising, or at least doable it didn't work for me. Neither changing the VS code language setting nor hacking the extension directly by manipulating extension.js to use The only thing that actually worked was to provide a separate environment variable to the chromium instance launched by puppeteer. What I needed to do was add Finally extension.js at around line 400 becomes: var customEnv = process.env;
customEnv.LANG = vscode.env.language;
var options = {
executablePath: vscode.workspace.getConfiguration('markdown-pdf')['executablePath'] || puppeteer.executablePath(),
args: ['--lang=' + vscode.env.language, '--no-sandbox', '--disable-setuid-sandbox'],
// Setting Up Chrome Linux Sandbox
// https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#setting-up-chrome-linux-sandbox
env: customEnv
}; In theory it should be way easier but this was the only workaround that solved this for me. PR is open here #267 - but the extension seems abandoned. Let's see if and how this continues. Cheers |
I'm in Canada, but there's no |
#267 doesn't care it is totally transparent to what locale you want to use. The important question is: Does vscode and/or chromium support the locale? Since the answer for 'en-CA' is no, it seems neither vscode nor chromium supports that, there will be a fallback locale. Presumably that is en(en-US) for you. tl;dr |
en-US is precisely the problem with the default date (compared to the rest of the world). It seems to be the reason there was a bug report of #95 and the user proposing a fix was apparently is in Australia, fixing it with Anyway, I hard-coded the The point I'm making is that it seems useless to pass the locale from VScode if the problem is English dates (UK, AU, CA, ?), since there's only one locale. A workaround would be a preference in the plug-in where you can pass the |
+1 from me to customise the date in settings. Thanks |
+1 from me to use a customizable date format in the header. |
+1 from me. I agree this functionality should be included in the extension. |
Thanks for the tip, @fuhrmanator! On Mac the file to modify is:
The line to change: vscode-markdown-pdf/extension.js Line 401 in d50e168
Example: - args: ['--lang='+vscode.env.language, '--no-sandbox', '--disable-setuid-sandbox']
+ args: ['--lang=fi-FI', '--no-sandbox', '--disable-setuid-sandbox'] Then run the "Developer: Reload Window" command via VS Code's Command Palette for the change to take effect. (The "Developer: Restart Extension Host" command might also do the trick.) |
Nice program.
Is there a simple way to change the date format in the pdf header to display the date as YYYY-MM-DD?
Thanks
The text was updated successfully, but these errors were encountered: