Skip to content

Commit 7bc3fc3

Browse files
committed
v3.0
- New class NetDateTimeFormat which suports only .NET compatible date and time patterns. - By exixtence of class NetDateTimeFormat, now, JsSimpleDateFormat only supports Java compatible date and time patterns. isNetCompat property is dropped and also the third parameter for constructor is dropped. - New classes for formatting/parsing duration: TimerFormat and TimerFormatSymbols - Adds some test scripts
1 parent 4c7eeab commit 7bc3fc3

26 files changed

+8927
-1760
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# OSX
2+
.DS_Store
3+
14
# Logs
25
logs
36
*.log
@@ -102,3 +105,6 @@ dist
102105

103106
# TernJS port file
104107
.tern-port
108+
109+
# VSCode
110+
.vscode

JsSimpleDateFormat.d.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*! ****
2+
JsSimpleDateFormat v3.0.0
3+
This library is for formatting and parsing date time
4+
5+
Copyright (C) AT Mulyana ([email protected])
6+
7+
This library is free software; you can redistribute it and/or modify it
8+
under the terms of the GNU Lesser General Public License version 3.0
9+
or later version
10+
See http://gnu.org/licenses/lgpl.html
11+
12+
Visit https://github.com/atmulyana/JsSimpleDateFormat
13+
*****/
14+
export class FormatError extends Error {
15+
}
16+
17+
export class JsDateFormatSymbols {
18+
constructor(sLocale: string);
19+
getAmPmStrings(): string[];
20+
getShortAmPmStrings(): string[];
21+
getEras(): string[];
22+
getMonths(): string[];
23+
getShortMonths(): string[];
24+
getShortWeekdays(): string[];
25+
getWeekdays(): string[];
26+
setAmPmStrings(arAmPmStrings: string[]): void;
27+
setEras(arEras: string[]): void;
28+
setMonths(arMonths: string[]): void;
29+
setShortMonths(arShortMonths: string[]): void;
30+
setShortWeekdays(arShortWeekdays: string[]): void;
31+
setWeekdays(arWeekdays: string[]): void;
32+
}
33+
34+
interface ParsingPosition {
35+
index: number;
36+
errorIndex?: number;
37+
}
38+
39+
export class JsSimpleDateFormat {
40+
constructor(sPattern: string, param: JsDateFormatSymbols | string | undefined);
41+
applyPattern(sPattern: string): void;
42+
format(oDate: Date): string;
43+
get2DigitYearStart(): Date;
44+
getDateFormatSymbols(): JsDateFormatSymbols;
45+
parse(s: string, oPos?: ParsingPosition): Date;
46+
set2DigitYearStart(oStartDate: Date): void;
47+
setDateFormatSymbols(oFormatSymbols: JsDateFormatSymbols): void;
48+
toPattern(): string;
49+
}

0 commit comments

Comments
 (0)