Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Introduced simplified LoadBirthday and LoadAnniversary.
[xestiaab/.git] / source / contacteditor / frmContactEditor-LoadBADays.cpp
index 767f6dd..4b3e669 100644 (file)
@@ -1,5 +1,93 @@
+// frmContactEditor-LoadBADays.cpp - frmContactEditor load birthday/anniversary subroutines.
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+
 #include "frmContactEditor.h"
 
+void frmContactEditor::LoadBirthday(wxString *BirthdayData, bool *BirthdayText){
+
+       if (*BirthdayText == FALSE){
+       
+               int DateYear = 0;
+               wxDateTime::Month DateMonth;
+               unsigned int DateDay;
+               
+               wxString wxSData;
+               
+               if (Birthday.Mid(0, 2) == wxT("--")){
+               
+                       // Skip year.
+               
+               } else {
+               
+                       DateYear = wxAtoi(BirthdayData->Mid(0,4));
+               
+               }
+               
+               DateMonth = (wxDateTime::Month)(wxAtoi(BirthdayData->Mid(4,2)) - 1);
+               DateDay = wxAtoi(BirthdayData->Mid(6,2));
+       
+               wxDateTime BDayDate(DateDay,DateMonth,DateYear);
+       
+               dapBirthday->SetValue(BDayDate);                                
+       
+       } else {
+       
+               txtBirthday->SetValue(*BirthdayData);
+       
+       }
+
+}
+
+void frmContactEditor::LoadAnniversary(wxString *AnniversaryData, bool *AnniversaryText){
+
+       if (*AnniversaryText == FALSE){
+       
+               int DateYear = 0;
+               wxDateTime::Month DateMonth;
+               int DateDay;
+               
+               wxString wxSData;
+               
+               if (Anniversary.Mid(0, 2) == wxT("--")){
+               
+                       // Skip year.
+               
+               } else {
+               
+                       DateYear = wxAtoi(AnniversaryData->Mid(0,4));
+               
+               }
+               
+               DateMonth = (wxDateTime::Month)(wxAtoi(AnniversaryData->Mid(4,2)) - 1);
+               DateDay = wxAtoi(AnniversaryData->Mid(6,2));                                    
+       
+               wxDateTime ADayDate(DateDay,DateMonth,DateYear);
+       
+               dapAnniversary->SetValue(ADayDate);
+       
+       } else {
+       
+               txtAnniversary->SetValue(*AnniversaryData);
+       
+       }
+
+}
+
 void frmContactEditor::LoadBDay(wxString wxSPropertySeg1, wxString wxSPropertySeg2, bool *BirthdayProcessed){
 
        // Process date. Preserve the remainder in the string.
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy