Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #543: Hebrew.d.diff.v2

File Hebrew.d.diff.v2, 1.5 kB (added by snoyberg, 1 year ago)

Correction of array offset and repositioning 0-length month in non-leap years

Line 
1 Index: Hebrew.d
2 ===================================================================
3 --- Hebrew.d    (revision 2492)
4 +++ Hebrew.d    (working copy)
5 @@ -25,10 +25,10 @@
6  
7    private const int[14][7] MonthDays = [
8      // month                                                    // year type
9 -    [ 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 ],
10 -    [ 0, 30, 29, 29, 29, 30, 29, 30, 29, 30, 29, 30, 29, 0 ],   // 1
11 -    [ 0, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 0 ],   // 2
12 -    [ 0, 30, 30, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 0 ],   // 3
13 +    [ 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0  ],
14 +    [ 0, 30, 29, 29, 29, 30, 29, 0,  30, 29, 30, 29, 30, 29 ],  // 1
15 +    [ 0, 30, 29, 30, 29, 30, 29, 0,  30, 29, 30, 29, 30, 29 ],  // 2
16 +    [ 0, 30, 30, 30, 29, 30, 29, 0,  30, 29, 30, 29, 30, 29 ],  // 3
17      [ 0, 30, 29, 29, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29 ],  // 4
18      [ 0, 30, 29, 30, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29 ],  // 5
19      [ 0, 30, 30, 30, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29 ]   // 6
20 @@ -233,19 +233,19 @@
21      switch (yearLength) {
22        case 353:
23          // "deficient"
24 -        return 0;
25 +        return 1;
26        case 383:
27          // "deficient" leap
28          return 4;
29        case 354:
30          // "normal"
31 -        return 1;
32 +        return 2;
33        case 384:
34          // "normal" leap
35          return 5;
36        case 355:
37          // "complete"
38 -        return 2;
39 +        return 3;
40        case 385:
41          // "complete" leap
42          return 6;