Ticket #6679: mythtv-6679-always_show_year_for_schedules_direct_expiration.patch

File mythtv-6679-always_show_year_for_schedules_direct_expiration.patch, 1.2 KB (added by sphery <mtdean@…>, 15 years ago)
  • libs/libmythtv/datadirect.cpp

     
    436436            QString ExtractDateFromMessage = pchars.right(20);
    437437            QDateTime EDFM = QDateTime::fromString(ExtractDateFromMessage,
    438438                                                   Qt::ISODate);
     439            QString SDDateFormat = GetMythDB()->GetSetting("DateFormat",
     440                                                           "ddd d MMMM");
     441            // Ensure we show the year when it's important, regardless of
     442            // specified DateFormat
     443            if ((!SDDateFormat.contains('y')) &&
     444                (EDFM.date().year() != QDate::currentDate().year()))
     445            {
     446                SDDateFormat.append(" (yyyy)");
     447            }
    439448            QString dateFormat = QString("%1 %2")
    440                     .arg(GetMythDB()->GetSetting("DateFormat", "ddd d MMMM"))
     449                    .arg(SDDateFormat)
    441450                    .arg(GetMythDB()->GetSetting("TimeFormat", "hh:mm"));
    442451            QString ExpirationDate = EDFM.toString(dateFormat);
    443452