BDateFormat: Properly map day values to ICU day-of-week.
Signed-off-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
958b7451be
commit
42745b94f8
@@ -84,10 +84,19 @@ public:
|
|||||||
BDate& output);
|
BDate& output);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
int _ConvertDayNumberToICU(int day) const;
|
||||||
|
|
||||||
U_ICU_NAMESPACE::DateFormat* _CreateDateFormatter(
|
U_ICU_NAMESPACE::DateFormat* _CreateDateFormatter(
|
||||||
const BDateFormatStyle style) const;
|
const BDateFormatStyle style) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline int
|
||||||
|
BDateFormat::_ConvertDayNumberToICU(int day) const
|
||||||
|
{
|
||||||
|
return day == 7 ? 1 : day + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // _B_DATE_FORMAT_H_
|
#endif // _B_DATE_FORMAT_H_
|
||||||
|
|||||||
@@ -366,7 +366,7 @@ BDateFormat::GetDayName(int day, BString& outName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
BStringByteSink stringConverter(&outName);
|
BStringByteSink stringConverter(&outName);
|
||||||
names[day].toUTF8(stringConverter);
|
names[_ConvertDayNumberToICU(day)].toUTF8(stringConverter);
|
||||||
|
|
||||||
delete simpleFormat;
|
delete simpleFormat;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user