OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../include/javascript/JavaScript.h" | 7 #include "../../include/javascript/JavaScript.h" |
8 #include "../../include/javascript/IJavaScript.h" | 8 #include "../../include/javascript/IJavaScript.h" |
9 #include "../../include/javascript/JS_Define.h" | 9 #include "../../include/javascript/JS_Define.h" |
10 #include "../../include/javascript/JS_Object.h" | 10 #include "../../include/javascript/JS_Object.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 END_JS_STATIC_GLOBAL_FUN() | 61 END_JS_STATIC_GLOBAL_FUN() |
62 | 62 |
63 IMPLEMENT_JS_STATIC_GLOBAL_FUN(CJS_PublicMethods) | 63 IMPLEMENT_JS_STATIC_GLOBAL_FUN(CJS_PublicMethods) |
64 | 64 |
65 struct stru_TbConvert | 65 struct stru_TbConvert |
66 { | 66 { |
67 FX_LPCSTR lpszJSMark; | 67 FX_LPCSTR lpszJSMark; |
68 FX_LPCSTR lpszCppMark; | 68 FX_LPCSTR lpszCppMark; |
69 }; | 69 }; |
70 | 70 |
71 static const stru_TbConvert fcTable[] = {"mmmm","%B", | 71 static const stru_TbConvert fcTable[] = { |
72 » "mmm", "%b", | 72 » { "mmmm","%B" }, |
73 » "mm", "%m", | 73 » { "mmm", "%b" }, |
| 74 » { "mm", "%m" }, |
74 //"m" | 75 //"m" |
75 » "dddd","%A", | 76 » { "dddd","%A" }, |
76 » "ddd", "%a", | 77 » { "ddd", "%a" }, |
77 » "dd", "%d", | 78 » { "dd", "%d" }, |
78 //"d", "%w", | 79 //"d", "%w", |
79 » "yyyy","%Y", | 80 » { "yyyy","%Y" }, |
80 » "yy", "%y", | 81 » { "yy", "%y" }, |
81 » "HH", "%H", | 82 » { "HH", "%H" }, |
82 //"H" | 83 //"H" |
83 » "hh", "%I", | 84 » { "hh", "%I" }, |
84 //"h" | 85 //"h" |
85 » "MM", "%M", | 86 » { "MM", "%M" }, |
86 //"M" | 87 //"M" |
87 » "ss", "%S", | 88 » { "ss", "%S" }, |
88 //"s | 89 //"s |
89 » "tt", "%p" | 90 » { "tt", "%p" }, |
90 //"t" | 91 //"t" |
91 }; | 92 }; |
92 | 93 |
93 static FX_LPCWSTR months[] = | 94 static FX_LPCWSTR months[] = |
94 { | 95 { |
95 (FX_LPCWSTR)L"Jan", (FX_LPCWSTR)L"Feb", (FX_LPCWSTR)L"Mar", (FX_LPCWSTR)
L"Apr", (FX_LPCWSTR)L"May", (FX_LPCWSTR)L"Jun", (FX_LPCWSTR)L"Jul", (FX_LPCWSTR)
L"Aug", (FX_LPCWSTR)L"Sep", (FX_LPCWSTR)L"Oct", (FX_LPCWSTR)L"Nov", (FX_LPCWSTR)
L"Dec" | 96 (FX_LPCWSTR)L"Jan", (FX_LPCWSTR)L"Feb", (FX_LPCWSTR)L"Mar", (FX_LPCWSTR)
L"Apr", (FX_LPCWSTR)L"May", (FX_LPCWSTR)L"Jun", (FX_LPCWSTR)L"Jul", (FX_LPCWSTR)
L"Aug", (FX_LPCWSTR)L"Sep", (FX_LPCWSTR)L"Oct", (FX_LPCWSTR)L"Nov", (FX_LPCWSTR)
L"Dec" |
96 }; | 97 }; |
97 | 98 |
98 static FX_LPCWSTR fullmonths[] = | 99 static FX_LPCWSTR fullmonths[] = |
99 { | 100 { |
(...skipping 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2315 nums.SetElement(nIndex,CJS_Value(isolate,(FX_LPCWSTR)sPart)); | 2316 nums.SetElement(nIndex,CJS_Value(isolate,(FX_LPCWSTR)sPart)); |
2316 } | 2317 } |
2317 | 2318 |
2318 if (nums.GetLength() > 0) | 2319 if (nums.GetLength() > 0) |
2319 vRet = nums; | 2320 vRet = nums; |
2320 else | 2321 else |
2321 vRet.SetNull(); | 2322 vRet.SetNull(); |
2322 | 2323 |
2323 return TRUE; | 2324 return TRUE; |
2324 } | 2325 } |
OLD | NEW |