Commit Graph
16 Commits
Author SHA1 Message Date
Akshay Agarwal defdefa89a docs/user: Update locale kit description.
- Delete the introduction from the kits list page, as it is already
under locale_intro.
- Update the description in locale_intro.
- Since the locale kit now lives in libbe, delete the paragraph about
libraries from the intro, and move the still relevant part about
liblocalestub to the catalog translation macros description in
Catalog.dox.
2017-09-06 07:47:47 +02:00
Akshay Agarwal 28eb6b3f2b Use formatters from locale kit to format time remaining/finish time.
Signed-off-by: Adrien Destugues <[email protected]>
2017-09-01 21:37:35 +02:00
Akshay Agarwal 22d88eb415 BCalendarView: Adjust day name format to available space.
* Use BDateFormat::GetDayName() to fetch weekday names.
* Use appropriate symbol width(Mon, Mo, M) depending on the frame width.
* Provide functionality to update day name header in case of locale
preferences change.

Signed-off-by: Adrien Destugues <[email protected]>
2017-09-01 20:20:06 +02:00
Akshay Agarwal ed3f47fe2e BDateFormatTest: Add tests for day and month names for all format syles.
Signed-off-by: Jessica Hamilton <[email protected]>
2017-08-31 10:27:26 +12:00
Akshay Agarwal ec3dbaa13f Use B_FULL_DATE_FORMAT as the default style value.
Signed-off-by: Jessica Hamilton <[email protected]>
2017-08-31 10:27:09 +12:00
Akshay Agarwal bb3ad41ada Implement functions to get localized long/short dayofweek name and short month name in BDateFormat.
Signed-off-by: Adrien Destugues <[email protected]>
2017-08-30 20:28:31 +02:00
Akshay Agarwal f2c460497c BDurationFormatTest: Add test cases for abbreviated format style.
Signed-off-by: Adrien Destugues <[email protected]>
2017-08-30 20:15:30 +02:00
Akshay Agarwal dadffbdbff BDurationFormatTest: Add test cases for abbreviated format style.
Signed-off-by: Adrien Destugues <[email protected]>
2017-08-30 19:32:48 +02:00
Akshay Agarwal b73f6bf1c9 BDurationFormatTest: Add test cases for abbreviated format style.
Signed-off-by: Adrien Destugues <[email protected]>
2017-08-26 15:48:24 +02:00
Akshay Agarwal ffdbd12882 Fix BDateFormatTest: Consider timezone in test cases.
* Issue: A time_t value of say '12345678' results into different timestamps
in different timezones. So the expected output will not match the result of
BDateFormat::Format() if the calendar's timezone is different from the
timezone of the expected output, and the tests 'TestFormat' and
'TestCustomFormat' will fail.

* Fix: Add timezone information in the test cases and pass the timezone
while calling BDateFormat::Format() in order to set the calendar's
timezone same as that of the expected output.

Signed-off-by: Adrien Destugues <[email protected]>
2017-08-26 12:19:59 +02:00
Akshay Agarwal cf91123041 Add unit tests for BRelativeDateTimeFormat.
Signed-off-by: Adrien Destugues <[email protected]>
2017-08-26 09:02:52 +02:00
Akshay Agarwal 1e4ab34cd7 Implement a formatter for relative dates.
Signed-off-by: Adrien Destugues <[email protected]>

It can give results such as "in 2 hours", "2 days ago", etc.
This is different from BDurationFormat which will just say "1 hour, 2
minute and 36 seconds"
2017-08-25 21:14:27 +02:00
Akshay Agarwal b32b6a8633 Fix highlighting current system date in BCalendarView.
Changing the year in Calendar View does not remove the highlighting from
previous highlighted day.

Changing the system date to a date in a different month(different from
the month currently set in calendar view) does not remove the highlighting
from currently highlighted day.

The disabled day number text belonging to the next month (month after
the one currently selected) gets wrongly highlighted while attempting
to highlight the day number text belonging to the current month.

Signed-off-by: Adrien Destugues <[email protected]>

ticket : #13605
2017-07-16 08:12:50 +02:00
Akshay Agarwal 8013f2e07d Highlight current system date in BCalendarView.
* Issue: In BCalendarView presently, there is no notion of a current date
and the current date is not highlighted. So in the deskbar tray calendar
which uses BCalendarView, we cannot know the current date once we change
the selected day.
* Fix: Make BCalendarView accept pulse messages, check for system date
with every pulse message and update the current date accordingly.
Highlight the current date by rendering its day number text in a
different color.

Signed-off-by: Adrien Destugues <[email protected]>

ticket : #13592
2017-07-14 09:44:26 +02:00
Akshay Agarwal ec6735b596 Handle UDAT_DAY_OF_WEEK_FIELD in BDateFormat::GetFields().
Handle the UDAT_DAY_OF_WEEK_FIELD case and assign the corresponding
BDateElement object i.e B_DATE_ELEMENT_WEEKDAY to the fields array
at the appropriate offset.

Signed-off-by: Adrien Destugues <[email protected]>

Fixes #13529
2017-05-26 08:22:24 +02:00
Akshay Agarwal f5c544b59a Fix style formatting issue in BTimeUnitFormat, update BDurationFormat accordingly.
* Issue: BTimeUnitFormat doesn't incorporate style formatting while
formatting a time unit. Format() does take style as an argument but the
style is not used anywhere. So currently the abbreviated style doesn't
work and by default the time unit is formatted to the full style.

* Fix: Move the style flag from BTimeUnitFormat::Format() to the
BTimeUnitFormat constructors and call the relevant icu::TimeUnitFormat
constructor. Map the Haiku defined style unit to the corresponding ICU
unit. Move the style flag from BDurationFormat::Format() to the
BDurationFormat constructors to map the changes in BTimeUnitFormat.

Signed-off-by: Adrien Destugues <[email protected]>

Fixes #13508
2017-05-17 19:53:46 +02:00