How to change the Absolute time range?

Hi!

I want to change the Abosolute time range use the mysql store start time and end time data?

QQ图片20210508095605

The mysql data is
微信截图_20210508095812

AND
Grafana version: v7.5.3
Data source type & version: mysql
OS Grafana is installed on: Windows 10
User OS & Browser: Chrome on Windows 10
Grafana plugins: Only built-in plugins

Thanks!~

Hi @lee,

If I understand correctly, you want to change how the absolute time range always appears, so that it shows the to time as 00:00:00 and not 23:59:59?

Yes,I want to let the SQL datasourse to change the granfana time range

hi @lee,

Sorry for the delay. I’m not sure there is a way to change that default behavior without modifying the source code. Here are some places where react-calendar is called in our codebase. Not sure but this effect might be built-in to that compnent:

packages/grafana-ui/package.json
61:    "react-calendar": "2.19.2",

packages/grafana-ui/src/components/DateTimePickers/DatePicker/DatePicker.tsx
2:import Calendar from 'react-calendar/dist/entry.nostyle';

packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker/TimeRangeForm.test.tsx
84:    expect(from).toHaveClass('react-calendar__tile--rangeStart');
85:    expect(to).toHaveClass('react-calendar__tile--rangeEnd');
96:    expect(from).toHaveClass('react-calendar__tile--rangeStart');
97:    expect(to).toHaveClass('react-calendar__tile--rangeEnd');

packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker/TimePickerCalendar.tsx
3:import Calendar from 'react-calendar/dist/entry.nostyle';
95:      .react-calendar__navigation__label,
96:      .react-calendar__navigation__arrow,
97:      .react-calendar__navigation {
105:      .react-calendar__month-view__weekdays {
119:      .react-calendar__month-view__days {
123:      .react-calendar__tile,
124:      .react-calendar__tile--now {
130:      .react-calendar__navigation__label,
131:      .react-calendar__navigation > button:focus,
136:      .react-calendar__tile--active,
137:      .react-calendar__tile--active:hover {
145:      .react-calendar__tile--rangeEnd,
146:      .react-calendar__tile--rangeStart {
162:      .react-calendar__tile--rangeStart {
167:      .react-calendar__tile--rangeEnd {

Thanks for your reply again.

I will read this code folder.

Hi,

I come here to ask the same question, in our case we want to change the Absolute time range, so that the end day cannot be anything sooner than 2 weeks ago. This would imply removing all quick filters such as last 24h, last day, etc etc all the way until removing until last 7 days.