diff --git a/src/generator.h b/src/generator.h index a34664d..6c71d3d 100644 --- a/src/generator.h +++ b/src/generator.h @@ -1305,10 +1305,10 @@ void Generator::DumpModelIfNeeded(morm::Model & model, std::vector void Generator::PrintDate(pt::Date * date, std::vector parameters, StreamType & out_stream) { - // IMPROVEME - // check for different formats depending on parameters + bool is_roman = HasParam(parameters, L"roman"); + bool is_no_sec = HasParam(parameters, L"no_sec"); - date->Serialize(out_stream); + date->Serialize(out_stream, is_roman, !is_no_sec); } @@ -1326,7 +1326,14 @@ bool Generator::PrintDatePart(pt::Date * date, const std::wstring & if( field == L"month" ) { if( !is_test ) - out_stream << date->month; + { + bool is_roman = HasParam(parameters, L"roman"); + + if( is_roman ) + pt::Date::SerializeMonthAsRoman(out_stream, date->month); + else + out_stream << date->month; + } } else if( field == L"day" )