7#ifndef FXJS_FX_DATE_HELPERS_H_
8#define FXJS_FX_DATE_HELPERS_H_
12#include "core/fxcrt/widestring.h"
18extern const wchar_t*
const kMonths[12];
34double FX_MakeDay(
int nYear,
int nMonth,
int nDay);
35double FX_MakeTime(
int nHour,
int nMin,
int nSec,
int nMs);
44 const WideString& format,
49using fxjs::FX_GetDateTime;
50using fxjs::FX_GetDayFromTime;
51using fxjs::FX_GetHourFromTime;
52using fxjs::FX_GetMinFromTime;
53using fxjs::FX_GetMonthFromTime;
54using fxjs::FX_GetSecFromTime;
55using fxjs::FX_GetYearFromTime;
56using fxjs::FX_IsValid24Hour;
57using fxjs::FX_IsValidDay;
58using fxjs::FX_IsValidMinute;
59using fxjs::FX_IsValidMonth;
60using fxjs::FX_IsValidSecond;
61using fxjs::FX_LocalTime;
62using fxjs::FX_MakeDate;
63using fxjs::FX_MakeDay;
64using fxjs::FX_MakeTime;
65using fxjs::FX_ParseDateUsingFormat;
66using fxjs::FX_ParseStringInteger;
#define JS_STATIC_GLOBAL_FUN(fun_name)
void Error(const WideString &message)
CPDFSDK_FormFillEnvironment * GetFormFillEnv() const
CJS_Runtime * GetRuntime() const
static void AFNumber_Keystroke_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static CJS_Result AFRange_Validate(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static CJS_Result AFPercent_Keystroke(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static void AFPercent_Format_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static void AFTime_FormatEx_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static double ParseDate(v8::Isolate *isolate, const WideString &value, bool *bWrongFormat)
static WideString PrintDateUsingFormat(double dDate, const WideString &format)
static void DefineJSObjects(CFXJS_Engine *pEngine)
static void AFDate_KeystrokeEx_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static void AFTime_KeystrokeEx_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static CJS_Result AFDate_Keystroke(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static void AFRange_Validate_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static void AFPercent_Keystroke_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static double ParseDateAsGMT(v8::Isolate *isolate, const WideString &value)
static CJS_Result AFMakeNumber(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static void AFTime_Format_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static CJS_Result AFNumber_Keystroke(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static CJS_Result AFDate_KeystrokeEx(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static void AFMergeChange_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static CJS_Result AFTime_Keystroke(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static CJS_Result AFParseDateEx(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static void AFSpecial_Keystroke_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static void AFSpecial_KeystrokeEx_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static CJS_Result AFTime_FormatEx(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static CJS_Result AFSimple_Calculate(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static CJS_Result AFSpecial_KeystrokeEx(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static CJS_Result AFSpecial_Format(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static CJS_Result AFPercent_Format(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static bool IsReservedMaskChar(wchar_t ch)
static CJS_Result AFMergeChange(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static v8::Local< v8::Array > AF_MakeArrayFromList(CJS_Runtime *pRuntime, v8::Local< v8::Value > val)
static void AFParseDateEx_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static CJS_Result AFSpecial_Keystroke(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static void AFMakeNumber_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static bool IsNumber(const WideString &str)
static CJS_Result AFDate_Format(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static void AFSimple_Calculate_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static void AFTime_Keystroke_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static void AFExtractNums_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static void AFSimple_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static bool MaskSatisfied(wchar_t c_Change, wchar_t c_Mask)
static void AFDate_FormatEx_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static CJS_Result AFNumber_Format(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static CJS_Result AFTime_KeystrokeEx(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static void AFSpecial_Format_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static CJS_Result AFExtractNums(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static CJS_Result AFDate_FormatEx(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
CJS_PublicMethods()=delete
static void AFDate_Format_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static double ParseDateUsingFormat(v8::Isolate *isolate, const WideString &value, const WideString &format, bool *bWrongFormat)
static CJS_Result AFTime_Format(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static void AFDate_Keystroke_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static CJS_Result AFSimple(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > params)
static void AFNumber_Format_static(const v8::FunctionCallbackInfo< v8::Value > &info)
static CJS_Result Success()
static CJS_Result Failure(JSMessage id)
const WideString & Error() const
static CJS_Result Failure(const WideString &str)
CJS_EventContext * GetCurrentEventContext() const
CPDFSDK_FormFillEnvironment * GetFormFillEnv() const override
CJS_Util(v8::Local< v8::Object > pObject, CJS_Runtime *pRuntime)
static uint32_t GetObjDefnID()
static void DefineJSObjects(CFXJS_Engine *pEngine)
static DataType ParseDataType(WideString *sFormat)
static WideString StringPrintx(const WideString &cFormat, const WideString &cSource)
const char * c_str() const
WideString & operator+=(const WideString &str)
ByteString ToUTF8() const
static WideString Format(const wchar_t *pFormat,...)
WideString & operator=(WideString &&that) noexcept
WideString & operator+=(const wchar_t *str)
WideString & operator+=(wchar_t ch)
bool EqualsASCIINoCase(ByteStringView that) const
CharType operator[](const size_t index) const
const wchar_t * c_str() const
WideString & operator=(const WideString &that)
static WideString FromASCII(ByteStringView str)
WideString & operator=(const wchar_t *str)
static WideString FormatInteger(int i)
bool FXSYS_IsDecimalDigit(wchar_t c)
#define JS_STATIC_METHOD(method_name, class_name)
WideString JSFormatErrorString(const char *class_name, const char *property_name, const WideString &details)
WideString JSGetStringFromID(JSMessage msg)
WideString operator+(const WideString &str1, const WideString &str2)
int FX_GetMonthFromTime(double dt)
const wchar_t *const kMonths[12]
int FX_ParseStringInteger(const WideString &str, size_t nStart, size_t *pSkip, size_t nMaxStep)
int FX_GetYearFromTime(double dt)
const wchar_t *const kFullMonths[12]
ConversionStatus FX_ParseDateUsingFormat(const WideString &value, const WideString &format, double *result)
double FX_MakeDate(double day, double time)
bool FX_IsValidMinute(int m)
int FX_GetDayFromTime(double dt)
int FX_GetSecFromTime(double dt)
bool FX_IsValidMonth(int m)
int FX_GetHourFromTime(double dt)
double FX_MakeDay(int nYear, int nMonth, int nDay)
bool FX_IsValidDay(int d)
bool FX_IsValidSecond(int s)
int FX_GetMinFromTime(double dt)
double FX_MakeTime(int nHour, int nMin, int nSec, int nMs)
double FX_LocalTime(double d)
bool FX_IsValid24Hour(int h)