diff --git a/lcl/calendar.pp b/lcl/calendar.pp index 53c0725185..6d5a95c7b0 100644 --- a/lcl/calendar.pp +++ b/lcl/calendar.pp @@ -282,6 +282,12 @@ end; procedure TCustomCalendar.CheckRange(ADate, AMinDate, AMaxDate: TDateTime); begin + //otherwise you get a message like "Invalid Date: 31-12-9999. Must be between 1-1-0001 and 31-12-9999" + if (ADate < Trunc(SysUtils.MinDateTime)) then + raise EInvalidDate.CreateFmt(rsDateTooSmall, [DateToStr(SysUtils.MinDateTime)]); + if (ADate > Trunc(SysUtils.MaxDateTime)) then + raise EInvalidDate.CreateFmt(rsDateTooLarge, [DateToStr(SysUtils.MaxDateTime)]); + if (ADate < AMinDate) or (ADate > AMaxDate) then raise EInvalidDate.CreateFmt(rsInvalidDateRangeHint, [DateToStr(ADate), DateToStr(AMinDate), DateToStr(AMaxDate)]); diff --git a/lcl/languages/lclstrconsts.ca.po b/lcl/languages/lclstrconsts.ca.po index a363cc0299..f47c2cc1ec 100644 --- a/lcl/languages/lclstrconsts.ca.po +++ b/lcl/languages/lclstrconsts.ca.po @@ -221,6 +221,16 @@ msgstr "" msgid "Custom ..." msgstr "" +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "" diff --git a/lcl/languages/lclstrconsts.co.po b/lcl/languages/lclstrconsts.co.po index 63263ca892..478adb5416 100644 --- a/lcl/languages/lclstrconsts.co.po +++ b/lcl/languages/lclstrconsts.co.po @@ -217,6 +217,16 @@ msgstr "Schedarii di cursore" msgid "Custom ..." msgstr "Persunalizatu…" +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Predefinitu" diff --git a/lcl/languages/lclstrconsts.cs.po b/lcl/languages/lclstrconsts.cs.po index a720885723..f7fa8fc673 100644 --- a/lcl/languages/lclstrconsts.cs.po +++ b/lcl/languages/lclstrconsts.cs.po @@ -220,6 +220,16 @@ msgstr "Ukazatel" msgid "Custom ..." msgstr "Vlastní..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Výchozí" diff --git a/lcl/languages/lclstrconsts.de.po b/lcl/languages/lclstrconsts.de.po index 19d070958d..332fd04094 100644 --- a/lcl/languages/lclstrconsts.de.po +++ b/lcl/languages/lclstrconsts.de.po @@ -219,6 +219,16 @@ msgstr "Zeiger" msgid "Custom ..." msgstr "Eigene ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Voreingestellt" diff --git a/lcl/languages/lclstrconsts.es.po b/lcl/languages/lclstrconsts.es.po index 048f9fa414..fd40c70f03 100644 --- a/lcl/languages/lclstrconsts.es.po +++ b/lcl/languages/lclstrconsts.es.po @@ -218,6 +218,16 @@ msgstr "Cursor" msgid "Custom ..." msgstr "Personalizado ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Predeterminado" diff --git a/lcl/languages/lclstrconsts.fi.po b/lcl/languages/lclstrconsts.fi.po index a73144bf93..c7c63ada8a 100644 --- a/lcl/languages/lclstrconsts.fi.po +++ b/lcl/languages/lclstrconsts.fi.po @@ -216,6 +216,16 @@ msgstr "Kursori" msgid "Custom ..." msgstr "Mukautetut ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Oletus" diff --git a/lcl/languages/lclstrconsts.fr.po b/lcl/languages/lclstrconsts.fr.po index f2077fbdee..9058212ede 100644 --- a/lcl/languages/lclstrconsts.fr.po +++ b/lcl/languages/lclstrconsts.fr.po @@ -218,6 +218,16 @@ msgstr "Curseur" msgid "Custom ..." msgstr "Personnalisé..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Par défaut" diff --git a/lcl/languages/lclstrconsts.he.po b/lcl/languages/lclstrconsts.he.po index 9f873f275e..dba5566028 100644 --- a/lcl/languages/lclstrconsts.he.po +++ b/lcl/languages/lclstrconsts.he.po @@ -220,6 +220,16 @@ msgstr "סמן" msgid "Custom ..." msgstr "מותאם אישית ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "ברירת מחדל" diff --git a/lcl/languages/lclstrconsts.hu.po b/lcl/languages/lclstrconsts.hu.po index 1fd7feea3b..e8bebf26a9 100644 --- a/lcl/languages/lclstrconsts.hu.po +++ b/lcl/languages/lclstrconsts.hu.po @@ -218,6 +218,16 @@ msgstr "Kurzor" msgid "Custom ..." msgstr "Egyéni ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Alapértelmezett" diff --git a/lcl/languages/lclstrconsts.id.po b/lcl/languages/lclstrconsts.id.po index 87f9ab1414..481f31c501 100644 --- a/lcl/languages/lclstrconsts.id.po +++ b/lcl/languages/lclstrconsts.id.po @@ -222,6 +222,16 @@ msgstr "" msgid "Custom ..." msgstr "" +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "" diff --git a/lcl/languages/lclstrconsts.it.po b/lcl/languages/lclstrconsts.it.po index ce19c28069..95739182af 100644 --- a/lcl/languages/lclstrconsts.it.po +++ b/lcl/languages/lclstrconsts.it.po @@ -220,6 +220,16 @@ msgstr "cursore" msgid "Custom ..." msgstr "Personalizzato ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Standard" diff --git a/lcl/languages/lclstrconsts.ja.po b/lcl/languages/lclstrconsts.ja.po index 28cb3dfda6..1ff58e52a1 100644 --- a/lcl/languages/lclstrconsts.ja.po +++ b/lcl/languages/lclstrconsts.ja.po @@ -218,6 +218,16 @@ msgstr "カーソルファイル" msgid "Custom ..." msgstr "カスタム色" +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "デフォルト色" diff --git a/lcl/languages/lclstrconsts.lt.po b/lcl/languages/lclstrconsts.lt.po index 54468c7ce2..ecb58fcea0 100644 --- a/lcl/languages/lclstrconsts.lt.po +++ b/lcl/languages/lclstrconsts.lt.po @@ -220,6 +220,16 @@ msgstr "Žymeklis" msgid "Custom ..." msgstr "Naudotojo…" +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Numatytasis" diff --git a/lcl/languages/lclstrconsts.nl.po b/lcl/languages/lclstrconsts.nl.po index 19b30251a5..1de95f28b6 100644 --- a/lcl/languages/lclstrconsts.nl.po +++ b/lcl/languages/lclstrconsts.nl.po @@ -223,6 +223,16 @@ msgstr "Cursor" msgid "Custom ..." msgstr "Aangepast ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Standaard" diff --git a/lcl/languages/lclstrconsts.no.po b/lcl/languages/lclstrconsts.no.po index 39f7acfa23..38e63a05ec 100644 --- a/lcl/languages/lclstrconsts.no.po +++ b/lcl/languages/lclstrconsts.no.po @@ -220,6 +220,16 @@ msgstr "" msgid "Custom ..." msgstr "" +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "" diff --git a/lcl/languages/lclstrconsts.pl.po b/lcl/languages/lclstrconsts.pl.po index 520364f1d2..a014b7ad43 100644 --- a/lcl/languages/lclstrconsts.pl.po +++ b/lcl/languages/lclstrconsts.pl.po @@ -219,6 +219,16 @@ msgstr "Kursor" msgid "Custom ..." msgstr "Inny..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Domyślny" diff --git a/lcl/languages/lclstrconsts.pot b/lcl/languages/lclstrconsts.pot index ae0ec7a29d..6e371e1696 100644 --- a/lcl/languages/lclstrconsts.pot +++ b/lcl/languages/lclstrconsts.pot @@ -207,6 +207,16 @@ msgstr "" msgid "Custom ..." msgstr "" +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "" diff --git a/lcl/languages/lclstrconsts.pt.po b/lcl/languages/lclstrconsts.pt.po index 7d8048922d..c4335f133a 100644 --- a/lcl/languages/lclstrconsts.pt.po +++ b/lcl/languages/lclstrconsts.pt.po @@ -216,6 +216,16 @@ msgstr "Cursor" msgid "Custom ..." msgstr "Personalizado ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Padrão" diff --git a/lcl/languages/lclstrconsts.pt_BR.po b/lcl/languages/lclstrconsts.pt_BR.po index f9452dac02..6920f8353f 100644 --- a/lcl/languages/lclstrconsts.pt_BR.po +++ b/lcl/languages/lclstrconsts.pt_BR.po @@ -218,6 +218,16 @@ msgstr "Cursor" msgid "Custom ..." msgstr "Personalizado ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Padrão" diff --git a/lcl/languages/lclstrconsts.ru.po b/lcl/languages/lclstrconsts.ru.po index e4d2224bc0..2f4fc8fd4f 100644 --- a/lcl/languages/lclstrconsts.ru.po +++ b/lcl/languages/lclstrconsts.ru.po @@ -214,6 +214,16 @@ msgstr "Файлы курсоров" msgid "Custom ..." msgstr "Пользовательский ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "По умолчанию" diff --git a/lcl/languages/lclstrconsts.sk.po b/lcl/languages/lclstrconsts.sk.po index 2a0c657081..2b7996246b 100644 --- a/lcl/languages/lclstrconsts.sk.po +++ b/lcl/languages/lclstrconsts.sk.po @@ -216,6 +216,16 @@ msgstr "Kurzorové súbory" msgid "Custom ..." msgstr "Vlastná ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Predvolené" diff --git a/lcl/languages/lclstrconsts.tr.po b/lcl/languages/lclstrconsts.tr.po index 5fd270b579..a0679b0bd7 100644 --- a/lcl/languages/lclstrconsts.tr.po +++ b/lcl/languages/lclstrconsts.tr.po @@ -218,6 +218,16 @@ msgstr "İmleç" msgid "Custom ..." msgstr "Özel ..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "Varsayılan" diff --git a/lcl/languages/lclstrconsts.uk.po b/lcl/languages/lclstrconsts.uk.po index 9d05460b73..9092814a62 100644 --- a/lcl/languages/lclstrconsts.uk.po +++ b/lcl/languages/lclstrconsts.uk.po @@ -221,6 +221,16 @@ msgstr "Курсор" msgid "Custom ..." msgstr "Власний..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "За замовчуванням" diff --git a/lcl/languages/lclstrconsts.zh_CN.po b/lcl/languages/lclstrconsts.zh_CN.po index f1c3074c46..f5603fb53e 100644 --- a/lcl/languages/lclstrconsts.zh_CN.po +++ b/lcl/languages/lclstrconsts.zh_CN.po @@ -219,6 +219,16 @@ msgstr "光标" msgid "Custom ..." msgstr "自定义..." +#: lclstrconsts.rsdatetoolarge +#, object-pascal-format +msgid "Date cannot be past %s" +msgstr "" + +#: lclstrconsts.rsdatetoosmall +#, object-pascal-format +msgid "Date cannot be before %s" +msgstr "" + #: lclstrconsts.rsdefaultcolorcaption msgid "Default" msgstr "默认" diff --git a/lcl/lclstrconsts.pas b/lcl/lclstrconsts.pas index 148ce357e5..2690836da7 100644 --- a/lcl/lclstrconsts.pas +++ b/lcl/lclstrconsts.pas @@ -238,6 +238,8 @@ resourceString rsScrollBarOutOfRange = 'ScrollBar property out of range'; rsInvalidDate = 'Invalid Date : %s'; rsInvalidDateRangeHint = 'Invalid Date: %s. Must be between %s and %s'; + rsDateTooLarge = 'Date cannot be past %s'; + rsDateTooSmall = 'Date cannot be before %s'; rsErrorOccurredInAtAddressFrame = 'Error occurred in %s at %sAddress %s%s' +' Frame %s'; rsException = 'Exception';