Skip to content

Commit

Permalink
refactor: remove z timezone (#448)
Browse files Browse the repository at this point in the history
* refactor: remove z timezone

* docs: remove z timezone
  • Loading branch information
iamkun authored Jan 12, 2019
1 parent bdbaa13 commit c0ebac0
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion docs/en/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ dayjs('05/02/69 1:02:03 PM -05:00', 'MM/DD/YY H:mm:ss A Z')
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `z` | EST | Time zone abbreviation |
| `Z` | -5:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
Expand Down
1 change: 0 additions & 1 deletion docs/es-es/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ dayjs('2010-04-01').quarter(); // 2
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `z` | EST | Time zone abbreviation |
| `Z` | -5:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
Expand Down
1 change: 0 additions & 1 deletion docs/ja/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ dayjs('05/02/69 1:02:03 PM -05:00', 'MM/DD/YY H:mm:ss A Z')
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `z` | EST | Time zone abbreviation |
| `Z` | -5:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
Expand Down
1 change: 0 additions & 1 deletion docs/ko/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ dayjs('05/02/69 1:02:03 PM -05:00', 'MM/DD/YY H:mm:ss A Z')
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `z` | EST | Time zone abbreviation |
| `Z` | -5:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
Expand Down
1 change: 0 additions & 1 deletion docs/pt-br/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ dayjs('05/02/69 1:02:03 PM -05:00', 'MM/DD/YY H:mm:ss A Z')
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `z` | EST | Time zone abbreviation |
| `Z` | -5:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
Expand Down
1 change: 0 additions & 1 deletion docs/zh-cn/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ dayjs('05/02/69 1:02:03 PM -05:00', 'MM/DD/YY H:mm:ss A Z')
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `z` | EST | Time zone abbreviation |
| `Z` | -5:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
Expand Down
5 changes: 0 additions & 5 deletions src/plugin/customParseFormat/parseFormattedInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const matchUpperCaseAMPM = /[AP]M/
const matchLowerCaseAMPM = /[ap]m/
const matchSigned = /[+-]?\d+/ // -inf - inf
const matchOffset = /[+-]\d\d:?\d\d/ // +00:00 -00:00 +0000 or -0000
const matchAbbreviation = /[A-Z]{3,4}/ // CET

function offsetFromString(string) {
const parts = string.match(/([+-]|\d\d)/g)
Expand Down Expand Up @@ -57,10 +56,6 @@ const expressions = {
this.year = input + (input > 68 ? 1900 : 2000)
}],
YYYY: [match4, addInput('year')],
z: [matchAbbreviation, function (input) {
const zone = this.zone || (this.zone = {})
zone.abbreviation = input
}],
Z: [matchOffset, function (input) {
const zone = this.zone || (this.zone = {})
zone.offset = offsetFromString(input)
Expand Down

0 comments on commit c0ebac0

Please sign in to comment.