It is currently Thu Nov 15, 2018 11:59 pm Advanced search

Range with hours and minutes

Technical support for the Highcharts Stock package

Range with hours and minutes

Postby maddmike1959 » Fri Jul 06, 2018 11:54 pm

Is it possible to have hours and minutes display in the Range Start and End dates?

Thanks
maddmike1959
 
Posts: 31
Joined: Thu Aug 17, 2017 10:40 pm

Re: Range with hours and minutes

Postby daniel_s » Sat Jul 07, 2018 4:20 pm

hi maddmike1959,

Yes of course. You can achieve the effect you expecting, by setting a couple of parameters, namely inputDateFormat, inputEditDateFormat and then you need to define the inputDateParser, because Highcharts have to know what to do with date from inputs. Finally, you need to increase the inputBoxWidth. Please take a look at code and example below:
Code: Select all
    rangeSelector: {
       inputBoxWidth: 110,
        inputDateFormat: '%b %e %Y, %H:%M',
        inputEditDateFormat: '%b,%e,%Y,%H,%M',
        // Custom parser to parse the %H:%M:%S.%L format
        inputDateParser: function (value) {
            var months = Highcharts.defaultOptions.lang.shortMonths
            value = value.split(",");
            return Date.UTC(
                parseInt(value[2], 10),
                months.indexOf(value[0]),
                parseInt(value[1], 10),
                parseInt(value[3], 10),
                parseInt(value[4], 10)
            );
        }
    },


Live example: http://jsfiddle.net/7dcoa1mb/1/

Best regards!
Daniel Studencki,
Highcharts Developer
daniel_s
 
Posts: 737
Joined: Fri Sep 01, 2017 1:01 pm

Re: Range with hours and minutes

Postby maddmike1959 » Mon Jul 09, 2018 8:43 pm

Thanks,

Is there any way to use a DateTime picker?

Mike
maddmike1959
 
Posts: 31
Joined: Thu Aug 17, 2017 10:40 pm

Re: Range with hours and minutes

Postby daniel_s » Tue Jul 10, 2018 10:08 am

hi maddmike1959,

Of course, but you need to use 3rd party library or code it by yourself. here is the example which shows how to use range selector combined with jQuery date picker: http://jsfiddle.net/BWEm5/542/
You can also search between the topics on this forum. I'm sure that you will find some helpful topics.

Best regards!
Daniel Studencki,
Highcharts Developer
daniel_s
 
Posts: 737
Joined: Fri Sep 01, 2017 1:01 pm


Return to Highstock Usage

Who is online

Users browsing this forum: No registered users and 0 guests