Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(872)

Unified Diff: fpdfsdk/javascript/JS_Value.cpp

Issue 1833053002: util.printd() replaces specified date with current date. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: h is wrong, not H. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | fpdfsdk/javascript/util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/JS_Value.cpp
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp
index 1da1525d09d6ecb587052d2c95a528d7e1eda7cc..5e403a524b6170b95ce6d356caf2d362216a70b4 100644
--- a/fpdfsdk/javascript/JS_Value.cpp
+++ b/fpdfsdk/javascript/JS_Value.cpp
@@ -778,15 +778,15 @@ int JS_GetDayFromTime(double dt) {
}
int JS_GetHourFromTime(double dt) {
- return (int)_Mod(FXSYS_floor((double)(dt / (60 * 60 * 1000))), 24);
+ return (int)_Mod(floor(dt / (60 * 60 * 1000)), 24);
}
int JS_GetMinFromTime(double dt) {
- return (int)_Mod(FXSYS_floor((double)(dt / (60 * 1000))), 60);
+ return (int)_Mod(floor(dt / (60 * 1000)), 60);
}
int JS_GetSecFromTime(double dt) {
- return (int)_Mod(FXSYS_floor((double)(dt / 1000)), 60);
+ return (int)_Mod(floor(dt / 1000), 60);
}
double JS_DateParse(const wchar_t* str) {
@@ -820,7 +820,7 @@ double JS_DateParse(const wchar_t* str) {
double date = v->ToNumber(context).ToLocalChecked()->Value();
if (!_isfinite(date))
return date;
- return date + _getLocalTZA() + _getDaylightSavingTA(date);
+ return JS_LocalTime(date);
}
}
}
@@ -869,7 +869,7 @@ bool JS_PortIsNan(double d) {
}
double JS_LocalTime(double d) {
- return JS_GetDateTime() + _getDaylightSavingTA(d);
+ return d + _getLocalTZA() + _getDaylightSavingTA(d);
}
std::vector<CJS_Value> JS_ExpandKeywordParams(
« no previous file with comments | « DEPS ('k') | fpdfsdk/javascript/util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698