From 485a0ba9a33485bd0c9cc1a00f2876c58af4fad8 Mon Sep 17 00:00:00 2001 From: Jess Telford Date: Mon, 3 Jun 2019 17:47:47 +1000 Subject: [PATCH] Clean up docs for `lightFormat` and `lightFormatters` (#1089) * Correct documentation for `lightFormat` It does not include timezone formatting options * Clean up lightFormatters docs Removing docs for codes which do not apply. --- src/_lib/format/lightFormatters/index.js | 38 ++---------------------- src/lightFormat/index.js | 10 ------- 2 files changed, 3 insertions(+), 45 deletions(-) diff --git a/src/_lib/format/lightFormatters/index.js b/src/_lib/format/lightFormatters/index.js index 87a8d54a02..b1191868f6 100644 --- a/src/_lib/format/lightFormatters/index.js +++ b/src/_lib/format/lightFormatters/index.js @@ -3,46 +3,14 @@ import addLeadingZeros from '../../addLeadingZeros/index.js' /* * | | Unit | | Unit | * |-----|--------------------------------|-----|--------------------------------| - * | a | AM, PM | A* | Milliseconds in day | - * | c | Stand-alone local day of week | C* | Localized hour w/ day period | - * | d | Day of month | D | Day of year | - * | e | Local day of week | E | Day of week | - * | f | | F* | Day of week in month | - * | g* | Modified Julian day | G | Era | + * | a | AM, PM | A* | | + * | d | Day of month | D | | * | h | Hour [1-12] | H | Hour [0-23] | - * | i! | ISO day of week | I! | ISO week of year | - * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | - * | k | Hour [1-24] | K | Hour [0-11] | - * | l* | (deprecated) | L | Stand-alone month | * | m | Minute | M | Month | - * | n | | N | | - * | o! | Ordinal number modifier | O | Timezone (GMT) | - * | p! | Long localized time | P! | Long localized date | - * | q | Stand-alone quarter | Q | Quarter | - * | r* | Related Gregorian year | R! | ISO week-numbering year | * | s | Second | S | Fraction of second | - * | t! | Seconds timestamp | T! | Milliseconds timestamp | - * | u | Extended year | U* | Cyclic year | - * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | - * | w | Local week of year | W* | Week of month | - * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | - * | y | Year (abs) | Y | Local week-numbering year | - * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) | + * | y | Year (abs) | Y | | * * Letters marked by * are not implemented but reserved by Unicode standard. - * - * Letters marked by ! are non-standard, but implemented by date-fns: - * - `o` modifies the previous token to turn it into an ordinal (see `format` docs) - * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, - * i.e. 7 for Sunday, 1 for Monday, etc. - * - `I` is ISO week of year, as opposed to `w` which is local week of year. - * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. - * `R` is supposed to be used in conjunction with `I` and `i` - * for universal ISO week-numbering date, whereas - * `Y` is supposed to be used in conjunction with `w` and `e` - * for week-numbering date specific to the locale. - * - `P` is long localized date format - * - `p` is long localized time format */ var formatters = { diff --git a/src/lightFormat/index.js b/src/lightFormat/index.js index 3591799e93..397bcdba3d 100644 --- a/src/lightFormat/index.js +++ b/src/lightFormat/index.js @@ -64,16 +64,6 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/ * | | SS | 00, 01, ..., 99 | * | | SSS | 000, 0001, ..., 999 | * | | SSSS | ... | - * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | - * | | XX | -0800, +0530, Z | - * | | XXX | -08:00, +05:30, Z | - * | | XXXX | -0800, +0530, Z, +123456 | - * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | - * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | - * | | xx | -0800, +0530, +0000 | - * | | xxx | -08:00, +05:30, +00:00 | - * | | xxxx | -0800, +0530, +0000, +123456 | - * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | * * @param {Date|Number} date - the original date * @param {String} format - the string of tokens