Implement new static function wxDateTime::GetFirstWeekDay()

This function tries to determine the preferred first day of week to use in
calendars. The procedure for obtaining this information is highly
platform-dependent, and is not possible on all platforms; in that case
Sunday is used as the fallback value.

Implementations are included for MSW, OSX, and Linux.
This commit is contained in:
Lauri Nurmi
2017-07-09 12:12:04 +03:00
parent 6527607af7
commit 94c35b2cdd
7 changed files with 142 additions and 0 deletions

View File

@@ -5949,6 +5949,28 @@ if test "$wxUSE_DATETIME" = "yes"; then
AC_DEFINE(WX_GMTOFF_IN_TM)
fi
AC_CACHE_CHECK([for _NL_TIME_FIRST_WEEKDAY in langinfo.h],
wx_cv_have_nl_time_first_weekday,
[
AC_TRY_COMPILE(
[
#define _GNU_SOURCE
#include <langinfo.h>
],
[
_NL_TIME_FIRST_WEEKDAY;
],
[
wx_cv_have_nl_time_first_weekday=yes
],
wx_cv_have_nl_time_first_weekday=no
)
])
if test "$wx_cv_have_nl_time_first_weekday" = "yes"; then
AC_DEFINE(HAVE_NL_TIME_FIRST_WEEKDAY)
fi
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
fi