Resolved issue #422. Date of birth: German data format.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-12-19 21:26:05 +02:00
parent a0b785ffd8
commit 40bf125fdf
2 changed files with 5 additions and 2 deletions

View File

@ -1889,6 +1889,7 @@ void TMainWindow::InitWindow()
const qint32 index = ui->comboBoxGender->findData(static_cast<int>(m->Gender()));
ui->comboBoxGender->setCurrentIndex(index);
ui->dateEditBirthDate->setDisplayFormat(QLocale::system().dateFormat());
ui->dateEditBirthDate->setDate(m->BirthDate());
ui->lineEditEmail->setText(m->Email());

View File

@ -64,6 +64,8 @@ const QString VMeasurements::GenderMale = QStringLiteral("male");
const QString VMeasurements::GenderFemale = QStringLiteral("female");
const QString VMeasurements::GenderUnknown = QStringLiteral("unknown");
const QString defBirthDate = QStringLiteral("1800-01-01");
//---------------------------------------------------------------------------------------------------------------------
VMeasurements::VMeasurements(VContainer *data)
:VDomDocument(),
@ -390,7 +392,7 @@ void VMeasurements::SetGivenName(const QString &text)
//---------------------------------------------------------------------------------------------------------------------
QDate VMeasurements::BirthDate() const
{
return QDate::fromString(UniqueTagText(TagBirthDate), "yyyy-MM-dd");
return QDate::fromString(UniqueTagText(TagBirthDate, defBirthDate), "yyyy-MM-dd");
}
//---------------------------------------------------------------------------------------------------------------------
@ -747,7 +749,7 @@ void VMeasurements::CreateEmptyIndividualFile(Unit unit)
personal.appendChild(createElement(TagGivenName));
QDomElement date = createElement(TagBirthDate);
date.appendChild(createTextNode(QStringLiteral("1800-01-01")));
date.appendChild(createTextNode(defBirthDate));
personal.appendChild(date);
QDomElement gender = createElement(TagGender);