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

Tooltip xDateFormatter option #17981

Closed
ravindUwU opened this issue Nov 16, 2022 · 2 comments
Closed

Tooltip xDateFormatter option #17981

ravindUwU opened this issue Nov 16, 2022 · 2 comments
Labels
Status: Has workaround Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. Type: Feature Request Used when a new feature is requested either directly or indirectly

Comments

@ravindUwU
Copy link

ravindUwU commented Nov 16, 2022

Description of the feature

A tooltip.xDateFormatter option that allows formatting timestamps with a non-dateFormat format, in addition to the tooltip.xDateFormat option.

This would be analogous to,

Library related to the feature

Highcharts

API example

xDateFormatter could be a (this: Point, timestamp: number) => string, and used as 👇,

import * as Highcharts from 'highcharts';
import { DateTime } from 'luxon';

options: Highcharts.Options = {
	// ...
	tooltip: {
		// Instead of a fixed format 👇
		xDateFormat: '%Y/%m/%d, %l:%M %P',

		// Delegate formatting to a different library (Luxon, in this case) 👇
		xDateFormatter(timestamp) {
			return DateTime.fromMillis(timestamp).toLocaleString(DateTime.DATETIME_SHORT);
		},
	},
};
@ravindUwU ravindUwU added the Type: Feature Request Used when a new feature is requested either directly or indirectly label Nov 16, 2022
@highsoft-bot highsoft-bot added this to To do in Development-Flow via automation Nov 16, 2022
@pawellysy
Copy link
Member

Thanks for creating this feature request!
As a workaround, you can use both methods mentioned above, where you can format the date the same way you described.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

@github-actions github-actions bot added the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label May 17, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
Development-Flow automation moved this from To do to Done May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Has workaround Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. Type: Feature Request Used when a new feature is requested either directly or indirectly
Projects
Development

No branches or pull requests

2 participants