| 1180 | } |
| 1181 | |
| 1182 | int FormatDateTime(const ImPlotTime& t, char* buffer, int size, ImPlotDateTimeSpec fmt) { |
| 1183 | int written = 0; |
| 1184 | if (fmt.Date != ImPlotDateFmt_None) |
| 1185 | written += FormatDate(t, buffer, size, fmt.Date, fmt.UseISO8601); |
| 1186 | if (fmt.Time != ImPlotTimeFmt_None) { |
| 1187 | if (fmt.Date != ImPlotDateFmt_None) |
| 1188 | buffer[written++] = ' '; |
| 1189 | written += FormatTime(t, &buffer[written], size - written, fmt.Time, fmt.Use24HourClock); |
| 1190 | } |
| 1191 | return written; |
| 1192 | } |
| 1193 | |
| 1194 | inline float GetDateTimeWidth(ImPlotDateTimeSpec fmt) { |
| 1195 | 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