投稿日付形式の変更

良い知らせは、私がしっかりした男として自分の問題の答えを見つけるために検索を使ったことです。さらに良い知らせは、その問題がすでに何度も取り上げられていることを発見したことです。さらにさらに良い知らせは、私が発見したトピックがすべて同じページに答えを指し示していたことです。しかし、悪い知らせは、そのページがもう利用できないことです :slight_smile:

なので、残念ですがここで質問させてください。

「Feb, 12」と「Feb 12」という奇妙な違いを避けるために、日付フォーマットはどこで定義すればよいのでしょうか?設定も検索しましたが、いくつかのオプションがあり、どれを変更すべきかが明確ではありません。

また、あえて挑発的に言わせていただくと、長年にわたりこのフォーマットが混乱を招くと多くのコメントが寄せられているにもかかわらず、なぜこのようなややこしいデフォルトの日付フォーマット(上記参照)が採用されているのでしょうか?

よろしくお願いいたします。

「いいね!」 1

そのトピックは完全に古くなっています。答えはこちらです

「いいね!」 1

Thank you, Jeff. It’s not too easy to distinguish topics that are wildly out of date :), given that the one you reference is almost 4 years old.

I did see that topic but it seemed like a bit of a hack. A string with “tiny” in the name feels like it should use YY. Modifying it to use YYYY may resolve one issue, but could have unintended consequences elsewhere, where it might be the preferred string precisely because it’s “tiny”.

Without knowing too much yet about where I’d make this change, I’m guessing a better approach would be to find the HTML that currently references the tiny string for post date and modify that to instead use the long form. I don’t know enough yet, though, to know where to do that and whether that makes the change vulnerable to product updates later.

What I do know is that I’m really not a big fan of that weird date format :slightly_smiling_face:

Thanks again Jeff.

Changing tiny and fixing what breaks with CSS is likely the easiest path.

Not trying to be argumentative, Jay, but why is changing the tiny string definition to use the long form and then hunting around to find / test other references to that string easier than simply changing the relevant template to use the appropriately named long form?

The former seems rather cumbersome for what seems like a simple change.

Are there issues with updating the “template” (not sure if Discourse used that term) to use the preferred format?

「いいね!」 1

Changing the value in the web interface is easy and doesn’t require you to override the template, which has lots of other stuff in it, that might change in the future. It is reasonably likely that nothing will break, and if it does, the css you’d change in a theme is exactly what you’d do by overriding the template. Further, if you override the template and it changes in the future you’ll have to find out that it changed and fix your version whenever that happens.

「いいね!」 1

This is simply editing text in the same way you would edit text anywhere in Discourse via Admin, Customize. It is not risky at all and cannot be “broken” by updates. It is the simplest and easiest way to achieve the customization you desire.

「いいね!」 1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.