spreadsheet
typeScript/javascript spreadsheet parser, with formulas.
git clone https://git.vogt.world/spreadsheet.git
Log | Files | README.md
← Commit log
commit
message
Fixing some typos in the plan
author
Ben Vogt <[email protected]>
date
2017-03-26 23:30:17
stats
2 file(s) changed, 9 insertions(+), 5 deletions(-)
files
README.md
src/RawFormulas/Date.ts
 1diff --git a/README.md b/README.md
 2index 0577656..6573009 100644
 3--- a/README.md
 4+++ b/README.md
 5@@ -85,11 +85,15 @@ MM, YYYY         MONTHDIG_YEAR_COMMA_DELIMIT             months, years
 6 ### Different Time Formats
 7 FORMAT           CONST NAME
 8 HHam             HOUR_MERIDIEM
 9-HH:MM            HOURS_OVERFLOW_MINUTES_OVERFLOW
10-HH:MMam          HOURS_MINUTES_OVERFLOW_MERIDIEM
11-HH:MM:SS         HOURS_MINUTES_SECONDS_OVERFLOW
12+HH:MM            OVERFLOW_HOURS_OVERFLOW_MINUTES
13+HH:MMam          HOURS_OVERFLOW_MINUTES_MERIDIEM
14+HH:MM:SS         OVERFLOW_HOURS_OVERFLOW_MINUTES_SECONDS
15 HH:MM:SSam       HOURS_MINUTES_SECONDS_OVERFLOW_MERIDIEM
16 
17+* Combine the different time formats into a single regular expression.
18+Throw errors based on whether some units have overflowed. For example 29:99 is ok, but 29:99pm is not ok. This way
19+we're only doubling the number of date-format regular expressions we have to generate. For example, we check
20+YEAR_MONTHDIG_DAY_SLASH_DELIMIT once, and then YEAR_MONTHDIG_DAY_SLASH_DELIMIT_WITH_TIME once.
21 
22 * Dates have special types
23 Like dollars, dates are special types, but can be compared as if they're primatives. For example, this statement is
24diff --git a/src/RawFormulas/Date.ts b/src/RawFormulas/Date.ts
25index ca8ddb5..c0c90a2 100644
26--- a/src/RawFormulas/Date.ts
27+++ b/src/RawFormulas/Date.ts
28@@ -223,7 +223,7 @@ var DATEVALUE = function (...values) : number {
29     }
30   }
31 
32-  // Check YEAR_MONTHDIG_DAY_SLASH_DELIMIT_WITH_HOURS_OVERFLOW_MINUTES_OVERFLOW, YYYY/MM/DD HH:mm, "1992/06/24 29:2922"
33+  // Check YEAR_MONTHDIG_DAY_SLASH_DELIMIT_WITH_OVERFLOW_HOURS_OVERFLOW_MINUTES, YYYY/MM/DD HH:mm, "1992/06/24 29:2922"
34   if (m === undefined) {
35     // For reference: https://regex101.com/r/xsqttP/4
36     const REG = DateRegExBuilder.DateRegExBuilder()