Describe the bug
Auto update modified date not follow configuration isModifiedDate
To Reproduce
Steps to reproduce the behavior:
Setup frontmatter.json
{"$schema":"https://frontmatter.codes/frontmatter.schema.json","frontMatter.content.autoUpdateDate":true,"frontMatter.preview.host":"http://localhost:4000","frontMatter.taxonomy.contentTypes":[{"name":"default","pageBundle":false,"fields":[{"title":"Title","name":"title","type":"string"},{"title":"Description","name":"description","type":"string"},{"title":"Publishing date","name":"date","type":"datetime","default":"{{now}}","isPublishDate":true,"dateFormat":"yyyy-MM-dd'T'HH:mm:ssXXX"},{"title":"Thumbnail","name":"thumbnail","type":"image"},{"title":"Is in draft","name":"draft","type":"boolean"},{"title":"Tags","name":"tags","type":"tags"},{"title":"Categories","name":"categories","type":"categories"},{"title":"updated","name":"updated","type":"datetime","default":"{{now}}","isModifiedDate":true,"dateFormat":"yyyy-MM-dd'T'HH:mm:ssXXX"},{"name":"permalink","editable":true,"type":"slug"},{"title":"Author","name":"author","type":"divider"}]}],"frontMatter.framework.id":"hexo","frontMatter.content.publicFolder":"hexo:post_asset_folder","frontMatter.content.pageFolders":[{"path":"[[workspace]]/posts","title":"Source Posts"}],"frontMatter.site.baseURL":"https://www.webmanajemen.com/"}
Open markdown frontmatter file format
Edit any text then save
Expected behavior
The modified date should follow format this config
That is weird, as the date formatting uses the dateFormat setting in the code. Which version of FM are you using? I cannot reproduce it with your configuration in the stable or beta versions.
That is weird, as the date formatting uses the `dateFormat` setting in the code. Which version of FM are you using? I cannot reproduce it with your configuration in the stable or beta versions.
https://github.com/estruyf/vscode-front-matter/assets/2900833/9ab1faf5-954b-40af-b692-34d1cae44116
<!-- github-comment-id:2151835107 -->
That is weird, as the date formatting uses the dateFormat setting in the code. Which version of FM are you using? I cannot reproduce it with your configuration in the stable or beta versions.
> That is weird, as the date formatting uses the `dateFormat` setting in the code. Which version of FM are you using? I cannot reproduce it with your configuration in the stable or beta versions.
version latest stable. here my screen record - https://drive.google.com/file/d/1n5mbJC9ihCSM1jSxaGMGUdyn3I0FASxY/view?usp=sharing
<!-- github-comment-id:2153603571 -->
@estruyf here my full project https://github.com/dimaslanjaka/source-posts/tree/master (branch master and dont forget `git submodule update -i -r`)
You can check which parts cause bugs.
<!-- github-comment-id:2153613084 -->
Interesting. I cannot reproduce it locally; it is only in a codespace. Will have to find a way how I can test it 🙃
Interesting. I cannot reproduce it locally; it is only in a codespace. Will have to find a way how I can test it 🙃
<!-- github-comment-id:2154242030 -->
Here you can see that the dateFormat value is used for formatting your date.
🤦♂️ - there is nothing wrong; it is just that the Codespaces clock is set to UTC. That is why the `XXX` results in `Z`.
So the `yyyy-MM-dd'T'HH:mm:ssXXX` format on a Codespace is formatted to: `2024-06-07T08:02:21Z`.
You can also see this in the `date-fns` its `format` method documentation: https://date-fns.org/v3.6.0/docs/format - `XXX` results in: -08:00, +05:30, Z
Also checked with extra logging in the output:

Here you can see that the `dateFormat` value is used for formatting your date.
<!-- github-comment-id:2154317555 -->
Here you can see that the dateFormat value is used for formatting your date.
when I tap Update NOW working (auto update post date disabled state)
only the auto update modified post wrong format
> 🤦♂️ - there is nothing wrong; it is just that the Codespaces clock is set to UTC. That is why the `XXX` results in `Z`.
>
> So the `yyyy-MM-dd'T'HH:mm:ssXXX` format on a Codespace is formatted to: `2024-06-07T08:02:21Z`.
>
> You can also see this in the `date-fns` its `format` method documentation: https://date-fns.org/v3.6.0/docs/format - `XXX` results in: -08:00, +05:30, Z
>
> Also checked with extra logging in the output:
>
> 
>
> Here you can see that the `dateFormat` value is used for formatting your date.
when I tap **Update NOW** working (auto update post date disabled state)

only the auto update modified post wrong format
<!-- github-comment-id:2164039698 -->
When you click on the now button, your browser triggers it, invoking it from the client side, which results in a correct value on your end.
When the automated date update gets invoked, it is on the "backend", which runs on the codespace itself. Because the codespace runs on UTC, it returns a different value.
When you click on the `now` button, your browser triggers it, invoking it from the client side, which results in a correct value on your end.
When the automated date update gets invoked, it is on the "backend", which runs on the codespace itself. Because the codespace runs on UTC, it returns a different value.
<!-- github-comment-id:2165069904 -->
@dimaslanjaka I found a solution and it is to set the timezone for your GH Codespace. I just wrote a blog post about it on how you can set the timezone for your codespace: https://www.eliostruyf.com/set-timezone-github-codespaces/
<!-- github-comment-id:2165516065 -->
# timezone.sh#!/bin/bash# Set timezone to Asia/Jakarta
sudo ln -sf /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
sudo timedatectl set-timezone Asia/Jakarta
echo"Timezone set to $(date)"
include the timezone script in .bashrc or .zshrc
# your other .bashrc or .zshrc configs# set timezoneif[ -f ~/dotfiles/timezone.sh ];then
chmod +x ~/dotfiles/timezone.sh
~/dotfiles/timezone.sh
elif[ -f ./timezone.sh ];then
chmod +x ./timezone.sh
./timezone.sh
fi
now rebuild your codespaces
after finish, open terminal execute command date
> @dimaslanjaka I found a solution and it is to set the timezone for your GH Codespace. I just wrote a blog post about it on how you can set the timezone for your codespace: https://www.eliostruyf.com/set-timezone-github-codespaces/
nice working.

here my step to get working (might useful for someone else):
- set timezone in `.devcontainer/devcontainer.json` => https://github.com/dimaslanjaka/source-posts/blob/d67d837dfc29f57b5f2e43cc9d264486a98c605e/.devcontainer/devcontainer.json#L1-L5
- add timezone change script in dotfiles repository
```bash
# timezone.sh
#!/bin/bash
# Set timezone to Asia/Jakarta
sudo ln -sf /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
sudo timedatectl set-timezone Asia/Jakarta
echo "Timezone set to $(date)"
```
- include the timezone script in `.bashrc` or `.zshrc`
```bash
# your other .bashrc or .zshrc configs
# set timezone
if [ -f ~/dotfiles/timezone.sh ]; then
chmod +x ~/dotfiles/timezone.sh
~/dotfiles/timezone.sh
elif [ -f ./timezone.sh ]; then
chmod +x ./timezone.sh
./timezone.sh
fi
```
- now rebuild your codespaces
- after finish, open terminal execute command `date`
<!-- github-comment-id:2166938052 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Describe the bug
Auto update modified date not follow configuration
isModifiedDateTo Reproduce
Steps to reproduce the behavior:
frontmatter.jsonExpected behavior
The modified date should follow format this config
looks like
2024-06-01T17:14:14+07:00- hexo date format issueScreenshots
look at
updated: 2024-06-02T00:02:57Z, it totally wrong andhexowill produce invalid date format.Desktop (please complete the following information):
That is weird, as the date formatting uses the
dateFormatsetting in the code. Which version of FM are you using? I cannot reproduce it with your configuration in the stable or beta versions.https://github.com/estruyf/vscode-front-matter/assets/2900833/9ab1faf5-954b-40af-b692-34d1cae44116
version latest stable. here my screen record - https://drive.google.com/file/d/1n5mbJC9ihCSM1jSxaGMGUdyn3I0FASxY/view?usp=sharing
@estruyf here my full project https://github.com/dimaslanjaka/source-posts/tree/master (branch master and dont forget
git submodule update -i -r)You can check which parts cause bugs.
Interesting. I cannot reproduce it locally; it is only in a codespace. Will have to find a way how I can test it 🙃
🤦♂️ - there is nothing wrong; it is just that the Codespaces clock is set to UTC. That is why the
XXXresults inZ.So the
yyyy-MM-dd'T'HH:mm:ssXXXformat on a Codespace is formatted to:2024-06-07T08:02:21Z.You can also see this in the
date-fnsitsformatmethod documentation: https://date-fns.org/v3.6.0/docs/format -XXXresults in: -08:00, +05:30, ZAlso checked with extra logging in the output:
Here you can see that the
dateFormatvalue is used for formatting your date.when I tap Update NOW working (auto update post date disabled state)
only the auto update modified post wrong format
When you click on the
nowbutton, your browser triggers it, invoking it from the client side, which results in a correct value on your end.When the automated date update gets invoked, it is on the "backend", which runs on the codespace itself. Because the codespace runs on UTC, it returns a different value.
@dimaslanjaka I found a solution and it is to set the timezone for your GH Codespace. I just wrote a blog post about it on how you can set the timezone for your codespace: https://www.eliostruyf.com/set-timezone-github-codespaces/
nice working.
here my step to get working (might useful for someone else):
.devcontainer/devcontainer.json=> https://github.com/dimaslanjaka/source-posts/blob/d67d837dfc29f57b5f2e43cc9d264486a98c605e/.devcontainer/devcontainer.json#L1-L5.bashrcor.zshrcdate