| 1142 | } |
| 1143 | |
| 1144 | int FormatDateTime(const ImPlotTime& t, char* buffer, int size, ImPlotDateTimeSpec fmt) { |
| 1145 | int written = 0; |
| 1146 | if (fmt.Date != ImPlotDateFmt_None) |
| 1147 | written += FormatDate(t, buffer, size, fmt.Date, fmt.UseISO8601); |
| 1148 | if (fmt.Time != ImPlotTimeFmt_None) { |
| 1149 | if (fmt.Date != ImPlotDateFmt_None) |
| 1150 | buffer[written++] = ' '; |
| 1151 | written += FormatTime(t, &buffer[written], size - written, fmt.Time, fmt.Use24HourClock); |
| 1152 | } |
| 1153 | return written; |
| 1154 | } |
| 1155 | |
| 1156 | inline float GetDateTimeWidth(ImPlotDateTimeSpec fmt) { |
| 1157 | static const ImPlotTime t_max_width = MakeTime(2888, 12, 22, 12, 58, 58, 888888); // best guess at time that maximizes pixel width |
no test coverage detected