chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp

// Copyright 2014 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#include "fxjs/fx_date_helpers.h"

#include <math.h>
#include <time.h>
#include <wctype.h>

#include <array>
#include <iterator>

#include "build/build_config.h"
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_system.h"
#include "fpdfsdk/cpdfsdk_helpers.h"

namespace fxjs {
namespace {

constexpr std::array<uint16_t, 12> kDaysMonth =;

constexpr std::array<uint16_t, 12> kLeapDaysMonth =;

double Mod(double x, double y) {}

double GetLocalTZA() {}

int GetDaylightSavingTA(double d) {}

bool IsLeapYear(int year) {}

int DayFromYear(int y) {}

double TimeFromYear(int y) {}

double TimeFromYearMonth(int y, int m) {}

int Day(double t) {}

int YearFromTime(double t) {}

int DayWithinYear(double t) {}

int MonthFromTime(double t) {}

int DateFromTime(double t) {}

size_t FindSubWordLength(const WideString& str, size_t nStart) {}

}  // namespace

const std::array<const char*, 12> kMonths =;

const std::array<const char*, 12> kFullMonths =;

static constexpr size_t KMonthAbbreviationLength =;  // Anything in |kMonths|.
static constexpr size_t kLongestFullMonthLength =;   // September

double FX_GetDateTime() {}

int FX_GetYearFromTime(double dt) {}

int FX_GetMonthFromTime(double dt) {}

int FX_GetDayFromTime(double dt) {}

int FX_GetHourFromTime(double dt) {}

int FX_GetMinFromTime(double dt) {}

int FX_GetSecFromTime(double dt) {}

bool FX_IsValidMonth(int m) {}

// TODO(thestig): Should this take the month into consideration?
bool FX_IsValidDay(int d) {}

// TODO(thestig): Should 24 be allowed? Similarly, 60 for minutes and seconds.
bool FX_IsValid24Hour(int h) {}

bool FX_IsValidMinute(int m) {}

bool FX_IsValidSecond(int s) {}

double FX_LocalTime(double d) {}

double FX_MakeDay(int nYear, int nMonth, int nDate) {}

double FX_MakeTime(int nHour, int nMin, int nSec, int nMs) {}

double FX_MakeDate(double day, double time) {}

int FX_ParseStringInteger(const WideString& str,
                          size_t nStart,
                          size_t* pSkip,
                          size_t nMaxStep) {}

ConversionStatus FX_ParseDateUsingFormat(const WideString& value,
                                         const WideString& format,
                                         double* result) {}

}  // namespace fxjs