~ubuntu-branches/ubuntu/lucid/haxe/lucid

« back to all changes in this revision

Viewing changes to haxe/std/mtwin/DateFormat.hx

  • Committer: Bazaar Package Importer
  • Author(s): Jens Peter Secher
  • Date: 2009-03-18 23:09:50 UTC
  • mfrom: (3.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090318230950-pgfuxg2ucolps74t
Tags: 1:2.2-2
* Use ocamlfind to locate and use the libraries xml-light and extlib
  which already exist in Debian as separate packages.
  (Closes: #519630)
* Fixed compile error with camlp4 3.11, thanks to Stéphane Glondu.
  (Closes: #519627)
* Use quilt instead of dpatch for patches, and describe how to use
  quilt in Debian.source (thanks to Russ Allbery).
* Added a Vcs-Hg control filed to indicate the location of the public
  repository.
* Bumped Standards-Version to 3.8.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
        static var REG_STD = ~/([0-9]{4})-([0-9]{2})-([0-9]{2})/;
5
5
        static var REG_A = ~/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([0-9]{1,2}), ([0-9]{2,4})/;
6
6
        static var REG_B = ~/([0-9]{1,2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([0-9]{2,4})/;
 
7
        static var REG_A2 = ~/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([0-9]{1,2}) .*? ([0-9]{4})$/;
 
8
        static var REG_B2 = ~/([0-9]{1,2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) .*? ([0-9]{4})$/;
7
9
        static var REG_HOUR = ~/([0-9]{2}):([0-9]{2}):([0-9]{2})/;
8
10
        static var REG_TZ = ~/(ADT|BST|NZT|NZST|IDLE|GST|EAST|JST|CCT|WAST|BT|EET|SWT|MEWT|MET|FWT|CET|IDLW|NT|HST|CAT|AHST|YST|AST|AT|WAT|WET|UTC|UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|YDT|HDT|MEST|MESZ|SST|FST|WADT|EADT|NZDT|[+-][0-9]{3,4}|[A-Z])$/;
9
11
        static var REG_SIMPLE_TZ = ~/[+-][0-9]{3,4}/;
86
88
                        y = Std.parseInt(REG_B.matched(3));
87
89
                        d = Std.parseInt(REG_B.matched(1));
88
90
                        m = month(REG_B.matched(2));
 
91
                }else if( REG_A2.match(str) ){
 
92
                        y = Std.parseInt(REG_A2.matched(3));
 
93
                        d = Std.parseInt(REG_A2.matched(2));
 
94
                        m = month(REG_A2.matched(1));
 
95
                }else if( REG_B2.match(str) ){
 
96
                        y = Std.parseInt(REG_B2.matched(3));
 
97
                        d = Std.parseInt(REG_B2.matched(1));
 
98
                        m = month(REG_B2.matched(2));
89
99
                }else{
90
100
                        return null;
91
101
                }
92
102
 
 
103
                if( y < 50 )
 
104
                        y += 2000;
 
105
                else if( y < 100 )
 
106
                        y += 1900;
 
107
 
93
108
                if( REG_HOUR.match(str) ){
94
109
                        h = Std.parseInt(REG_HOUR.matched(1));
95
110
                        i = Std.parseInt(REG_HOUR.matched(2));