Move DateTimeFormat and NumberFormat out of BLocale

* ... and adjust all callers
* Remove NumberFormatImpl: we rely on ICU to provide this and it can be
fully wrapped into the C++ file. The class was a stub anyway.
* "Monetary" format is included in NumberFormat for now. There may be a
more generic solution to handle monetary and BTimeUnitFormat (and other
arbitrary units)
This commit is contained in:
Adrien Destugues
2014-10-02 09:19:54 +02:00
parent 9581e328bd
commit e3857211d3
15 changed files with 370 additions and 433 deletions
+2 -2
View File
@@ -22,6 +22,7 @@
#include <AppFileInfo.h>
#include <Application.h>
#include <Bitmap.h>
#include <DateTimeFormat.h>
#include <DurationFormat.h>
#include <File.h>
#include <FindDirectory.h>
@@ -514,11 +515,10 @@ AboutView::AboutView()
kernelTimeDate << systemInfo.kernel_build_date
<< " " << systemInfo.kernel_build_time;
BString buildTimeDate;
const BLocale* locale = BLocale::Default();
time_t buildTimeDateStamp = parsedate(kernelTimeDate, -1);
if (buildTimeDateStamp > 0) {
if (locale->FormatDateTime(&buildTimeDate, buildTimeDateStamp,
if (BDateTimeFormat().Format(buildTimeDate, buildTimeDateStamp,
B_LONG_DATE_FORMAT, B_MEDIUM_TIME_FORMAT) != B_OK)
buildTimeDate.SetTo(kernelTimeDate);
} else