diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-01-16 20:39:19 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-01-16 20:39:19 +0100 |
commit | 99b67b42f6844701667fe01b5d781d03ce299d59 (patch) | |
tree | eea21b36fb78c1e097722f35d20953db7b4654ec /epgsearch.cpp | |
parent | e74f6bd540102bc23bb8d8e3d87fd3831e712503 (diff) | |
download | vdr-plugin-live-99b67b42f6844701667fe01b5d781d03ce299d59.tar.gz vdr-plugin-live-99b67b42f6844701667fe01b5d781d03ce299d59.tar.bz2 |
- fix for #418 via DatePicker
Diffstat (limited to 'epgsearch.cpp')
-rw-r--r-- | epgsearch.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/epgsearch.cpp b/epgsearch.cpp index 622ef21..d22c636 100644 --- a/epgsearch.cpp +++ b/epgsearch.cpp @@ -320,17 +320,6 @@ string SearchTimer::StopTimeFormatted() return FormatDateTime(tr("%I:%M %p"), stop); } -// format is in datepicker format ('mm' for month, 'dd' for day, 'yyyy' for year) -string DatePickerToC(time_t date, string const& format) -{ - if (date == 0) return ""; - string cformat = format; - cformat = StringReplace(cformat, "mm", "%m"); - cformat = StringReplace(cformat, "dd", "%d"); - cformat = StringReplace(cformat, "yyyy", "%Y"); - return FormatDateTime(cformat.c_str(), date); -} - string SearchTimer::UseAsSearchTimerFrom(string const& format) { return DatePickerToC(m_useAsSearchTimerFrom, format); @@ -341,22 +330,6 @@ string SearchTimer::UseAsSearchTimerTil(string const& format) return DatePickerToC(m_useAsSearchTimerTil, format); } -time_t GetDateFromDatePicker(std::string const& datestring, std::string const& format) -{ - if (datestring.empty()) - return 0; - int year = lexical_cast< int >(datestring.substr(format.find("yyyy"), 4)); - int month = lexical_cast< int >(datestring.substr(format.find("mm"), 2)); - int day = lexical_cast< int >(datestring.substr(format.find("dd"), 2)); - struct tm tm_r; - tm_r.tm_year = year - 1900; - tm_r.tm_mon = month -1; - tm_r.tm_mday = day; - tm_r.tm_hour = tm_r.tm_min = tm_r.tm_sec = 0; - tm_r.tm_isdst = -1; // makes sure mktime() will determine the correct DST setting - return mktime(&tm_r); -} - void SearchTimer::SetUseAsSearchTimerFrom(std::string const& datestring, std::string const& format) { m_useAsSearchTimerFrom = GetDateFromDatePicker(datestring, format); |