diff options
-rw-r--r-- | source/pdf/js/util.js | 13 | ||||
-rw-r--r-- | source/pdf/js/util.js.h | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/source/pdf/js/util.js b/source/pdf/js/util.js index dd58dff7..038014c3 100644 --- a/source/pdf/js/util.js +++ b/source/pdf/js/util.js @@ -554,6 +554,19 @@ function AFParseDateEx(d, fmt) { dout.setHours(12, 0, 0); + if (nums.length == 1 && nums[0].length == fmt.length && !text_month) { + // One number string, exactly matching the format string in length. + // Split it into separate strings to match the fmt + var num = nums[0]; + nums = [""]; + for (i = 0; i < fmt.length; i++) + { + nums[nums.length-1] += num.charAt(i); + if (i+1 < fmt.length && fmt.charAt(i) != fmt.charAt(i+1)) + nums.push(""); + } + } + if (!nums || nums.length < 1 || nums.length > 3) return null; diff --git a/source/pdf/js/util.js.h b/source/pdf/js/util.js.h index a8bf9619..2cf8a0af 100644 --- a/source/pdf/js/util.js.h +++ b/source/pdf/js/util.js.h @@ -554,6 +554,19 @@ "\n" "dout.setHours(12, 0, 0);\n" "\n" +"if (nums.length == 1 && nums[0].length == fmt.length && !text_month) {\n" +"\n" +"\n" +"var num = nums[0];\n" +"nums = [\"\"];\n" +"for (i = 0; i < fmt.length; i++)\n" +"{\n" +"nums[nums.length-1] += num.charAt(i);\n" +"if (i+1 < fmt.length && fmt.charAt(i) != fmt.charAt(i+1))\n" +"nums.push(\"\");\n" +"}\n" +"}\n" +"\n" "if (!nums || nums.length < 1 || nums.length > 3)\n" "return null;\n" "\n" |