Localized date format in tooltip - amcharts

In my chart I'm displaying revenue data on a date axis by day. I would like to show the date in the tooltip formatted by locale setting, i.e.
* en-us: 2019-03-19
* de DE: 19.03.2019
I created a codepen inspired by the amcharts example here: https://codepen.io/Me12345678/pen/vPorre
When I specify a locale, the tooltip is still showing the en-US format:
chart.language.locale = am4lang_de_DE;
I can format the date in the tooltip text, but then the format is static and won't change with the locale:
series.tooltipText = `{dateX.formatDate("dd MMM yyyy")}: [b]{valueY}[/]`;
Is there any way to specify an abstract format like "date without time" or "date with time" or "month only", so that amcharts displays it according to the locale setting?
Thanks for reading :-)

try this formatDate(\"dd.MM.YYYY\")
series.tooltipText = "[bold]{date.formatDate(\"dd.MM.YYYY\")}[/] \n + [bold]{valueY}[/]";

Related

Tempus Dominus allowMultiDate incorrectly places current date into input field

I am trying to implement a multidate input with Tempus Dominus. I set the picker to display a month or so in advance. I have useCurrent set to false.
When I select a date from the picker a month or so in advance the current date is inserted also and the picker pane jumps back to current dates month pane.
I am wondering if there is a work around or do I have to modify the code.
Please see the jsfiddle
$(function() {
var minDate = moment().add(2, 'months').startOf('month');
$('#datetimepicker1').datetimepicker({
allowMultidate: true,
useCurrent: false,
viewDate: minDate,
format: 'DD/MM/YYYY',
multidateSeparator: ','
});
});
Tempus Dominus Incorrectly Inserted Date
JSFiddle Tempus Dominus

kendo datepicker - set date without looking maxdate

I have one kind of scenario using date picker. I have date picker with max date=current date + 10 days,on page load only i want to show date more than the max date,but I'm allowing user to enter only up to max date. Is it possible. Without looking maxing date i want to display only the date what ever i want.code:-
var datepicker = $("#date" + uid).data("kendoDatePicker");
var addDays = new Date();
if (arr[1] == "") {
var d = new Date();
datepicker.min(new Date());
datepicker.max(new Date(d.getDate() , d.getMonth(), d.getDate()+ parseInt(arr[1]) - parseInt(1)));
}
I don't know if this is achievable. But what if you try to add two date pickers instead? One that display only the text, and the other only the calendar button. You need to play a bit the CSS, but I think it could spare you a lot of time.

Telerik Rad Grid change display format and interval for filter time picker

I have a grid column as follows in my WebForms application:
<telerik:GridDateTimeColumn CurrentFilterFunction="GreaterThanOrEqualTo" DataField="ClockedInAt" DataType="System.DateTime" EditDataFormatString="dd-MMM-yyyy HH:mm" FilterControlAltText="Filter column column" FilterDateFormat="dd-MMM-yyyy HH:mm" PickerType="DateTimePicker" UniqueName="column">
</telerik:GridDateTimeColumn>
I want to change the Time Picker displayed in the filter bar to:
Display time in 24 hour format viz HH:mm
Change the interval from 1 hour to 30 mins
How can I achieve this?

Hide the date part on a DateTime field

I would like to have a time-only field on my CRM form. As it is apparently not possible, I plan to use a DateTime field and hide the date part (circled in red on the following image).
How can I hide the date part on a DateTime field using Javascript ?
Found it:
// Set the date in order to be able to modify the time
document.getElementById("field_name").DataValue = new Date(2000, 1, 1);
// Hide the date part
document.getElementById("field_name").childNodes[0].childNodes[0].style.display =
"none";
document.getElementById("field_name").childNodes[0].childNodes[1].style.display =
"none";

How to show DateField with AM/PM format in blackberry?

I don't know how to show Time in AM/PM format in blackberry using blackberry datefield.Pls give me a idea how to do this.
Use SimpleDateFormat:
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss aa");
long date = System.currentTimeMillis();
DateField dateField = new DateField("time:", date, timeFormat);
add(dateField);
alt text http://img171.imageshack.us/img171/7642/timeformat.jpg

Resources