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

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

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

Zwelf opened this issue Nov 19, 2023 · 5 comments

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
@Tyrrrz
Copy link
Owner

Tyrrrz commented Aug 6, 2024

Closing this issue as "won't fix". HTML format is designed to mimic the look/behavior/feel of the Discord client as closely as possible. The dates, in particular, are rendered according to the selected culture, mimicking Discord's "language" setting. Note that you can hover your cursor over any date in the export, and it will show the timestamp in a more precise format. The bottom of the export file also contains the UTC offset used to calculate timestamps, and you can also override it to UTC+0 in settings.

For precise data processing, it's recommended to use the JSON format instead — it will, among others, preserve dates in ISO8601.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants