Ticket #5047: mythweather-datetime.patch

File mythweather-datetime.patch, 1.0 KB (added by otto at kolsi dot fi, 12 years ago)
  • mythweather/mythweather/weatherScreen.cpp

     
    269269
    270270void WeatherScreen::clock_tick()
    271271{
    272     QDateTime new_time(QDateTime::currentDateTime());
    273     QString curDate;
    274     if (QString(gContext->GetSetting("Language")) == "JA")
    275         curDate = new_time.toString("M/d (ddd) h:mm ap");
    276     else
    277         curDate = new_time.toString("MMM d h:mm ap");
     272    QString timeFormat = gContext->GetSetting("TimeFormat", "h:mm AP");
     273    QString dateFormat = gContext->GetSetting("DateFormat", "ddd MMMM d");
    278274
    279     curDate = new_time.date().toString(Qt::LocalDate);
    280     curDate += new_time.time().toString(" h:mm ap");
     275    QDateTime new_time(QDateTime::currentDateTime());
     276    QString curDate = new_time.date().toString(dateFormat);
     277    curDate += " " + new_time.time().toString(timeFormat);
    281278    setValue("currentdatetime", curDate);
    282279}
    283280