Skip to content
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

How to configure rfc3339/iso8601 date format in HTML output? #1158

Open
4 of 5 tasks
Zwelf opened this issue Nov 19, 2023 · 4 comments
Open
4 of 5 tasks

How to configure rfc3339/iso8601 date format in HTML output? #1158

Zwelf opened this issue Nov 19, 2023 · 4 comments
Labels

Comments

@Zwelf
Copy link

Zwelf commented Nov 19, 2023

Version

v2.41

Flavor

CLI (Command-Line Interface)

Platform

linux

Export format

HTML

Steps to reproduce

With --date replacing --locale, I don't see any way to configure iso8601 date format for html output. Do I miss how to configure it? Otherwise I'd be really happy if I could set a "international" iso8601 locale.

Details

  • Expected behavior: dateformat is "YYYY-MM-DD HH:SSZ" (rfc3339/iso8601) formatted.
  • Got behavior: date format is in american format (mm/dd/yyyy ...)

Checklist

  • I have looked through existing issues to make sure that this bug has not been reported before
  • I have provided a descriptive title for this issue
  • I have made sure that that this bug is reproducible on the latest version of the application
  • I have provided all the information needed to reproduce this bug as efficiently as possible
  • I have sponsored this project
@Zwelf Zwelf added the bug label Nov 19, 2023
@Zwelf Zwelf changed the title How to configure rfc3339/iso8601 date format in output? How to configure rfc3339/iso8601 date format in html output? Nov 19, 2023
@Tyrrrz
Copy link
Owner

Tyrrrz commented Nov 19, 2023

Yes, --dateformat was removed as part of #879. The main reason for that was that the application used a lot more than just one format, but only one of them was somewhat configurable.

The locale option generally offers more flexibility, as you can achieve the same behavior that the Discord app provides via the Language tab in settings. Unfortunately, that also means setting a non-locale-specific date format (such as ISO8601) is no longer possible.

Note that if you hover over the date, the tooltip will show the date in a locale-specific full date-time format, which is mostly unambiguous (unlike mm/dd/yyyy). Otherwise, if you really need deterministic timestamp formats, it's recommended to use the JSON export instead. The HTML export is intended to mimic the look and behavior of the Discord app.

@Zwelf
Copy link
Author

Zwelf commented Nov 19, 2023

Thanks for your fast reply :). How viable would it be to add some iso-locale and special case it to always use this format?

Digging through #879, it seems like I would need to modify FormatDate, CultureInfo = ... and probably AvailableLocales? Would you accept a pr that adds such a locale, or would you prefer some other command line argument? (Not sure yet if and when I have time to get to creating a pr)

@Tyrrrz
Copy link
Owner

Tyrrrz commented Nov 20, 2023

Would you accept a pr that adds such a locale, or would you prefer some other command line argument?

I don't think I want to include it in the scope of the project, at least as of now. You're welcome to make a fork for your own usage, though.

@p5nbTgip0r
Copy link

The en-SE locale provides a similar format to ISO8601: 2024-01-12 21:31, tooltip: Friday, 12 January 2024 21:31

This is the snippet I used to list locales and their date formats: https://dotnetfiddle.net/TWm6Et

using System;
using System.Globalization;

class Program
{
    static void Main()
    {
		const string format = "{0,-11} | {1}";
		foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.AllCultures))
		{
			Console.WriteLine(format, ci.Name, ci.DateTimeFormat.ShortDatePattern);
		}
    }
}

@Tyrrrz Tyrrrz changed the title How to configure rfc3339/iso8601 date format in html output? How to configure rfc3339/iso8601 date format in HTML output? Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants