mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 23:37:34 +00:00
tweak
This commit is contained in:
@@ -160,8 +160,7 @@ static void parse_transition_time(const char *&p, DSTRule &rule) {
|
||||
}
|
||||
}
|
||||
|
||||
void julian_to_month_day(int julian_day, int year, int &out_month, int &out_day) {
|
||||
(void) year; // Unused - J format ignores leap years by design
|
||||
void julian_to_month_day(int julian_day, int &out_month, int &out_day) {
|
||||
// J format: day 1-365, Feb 29 is NOT counted even in leap years
|
||||
// So day 60 is always March 1
|
||||
static const int DAYS_BEFORE_MONTH[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
|
||||
|
||||
@@ -94,10 +94,9 @@ bool parse_dst_rule(const char *&p, DSTRule &rule);
|
||||
|
||||
/// Convert Julian day (J format, 1-365 not counting Feb 29) to month/day
|
||||
/// @param julian_day Day number 1-365
|
||||
/// @param year The year (for leap year calculation)
|
||||
/// @param[out] month Output: month 1-12
|
||||
/// @param[out] day Output: day of month
|
||||
void julian_to_month_day(int julian_day, int year, int &month, int &day);
|
||||
void julian_to_month_day(int julian_day, int &month, int &day);
|
||||
|
||||
/// Convert day of year (plain format, 0-365 counting Feb 29) to month/day
|
||||
/// @param day_of_year Day number 0-365
|
||||
|
||||
Reference in New Issue
Block a user