From 02e14be417e9ea02f29911f78004f9a6a336e5e2 Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Wed, 7 Dec 2022 13:30:44 -0600 Subject: [PATCH 01/18] correcting the component status migrator to handle misc files for a component, fix inconsistencies in preview files, and adjust css imports --- component_status_migrator.thor | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/component_status_migrator.thor b/component_status_migrator.thor index 6d853be71f..850632a3f0 100644 --- a/component_status_migrator.thor +++ b/component_status_migrator.thor @@ -38,6 +38,14 @@ class ComponentStatusMigrator < Thor::Group move_file("template", template_path, template_path_with_status) end + def move_reamining_files + Dir["app/components/primer/#{name.underscore}.*"].each do |file_path| + file_name = File.basename(file_path) + new_path = "#{status_full_path}#{file_name}" + move_file("misc", file_path, new_path) + end + end + def move_test move_file("test", test_path, test_path_with_status) end @@ -69,7 +77,11 @@ class ComponentStatusMigrator < Thor::Group end def remove_suffix_from_preview_class - if name == name_without_suffix + if preview_path.include?("_component") && !name.include?("Component") # rubocop:disable Rails/NegateInclude + # if the class name does not include 'Component', but the file name does include '_component', + # this line will correct it by removing the incosistency with the word 'Component' + gsub_file(preview_path_with_status, "class #{name}Component", "class #{name_without_suffix}") + elsif name == name_without_suffix puts "No change needed - component suffix not removed from lookbook preview class name" else gsub_file(preview_path_with_status, "class #{name}", "class #{name_without_suffix}") @@ -90,6 +102,13 @@ class ComponentStatusMigrator < Thor::Group gsub_file(nav_file, "url: \"/components/#{name_without_suffix.downcase}\"", "url: \"/components/#{status_url}#{name_without_suffix.downcase}\"") end + def update_primer_js_imports + primer_js = "app/components/primer/primer.ts" + original_content = "import './#{name.underscore}'" + updated_content = "import './#{status_folder_name}#{name_without_suffix.underscore}'" + gsub_file(primer_js, original_content, updated_content) + end + def update_all_references exclude_files = [ ".overmind.sock", @@ -202,7 +221,11 @@ class ComponentStatusMigrator < Thor::Group end def preview_path - @preview_path ||= "previews/primer/#{name.underscore}_preview.rb" + @preview_path ||= begin + path = "previews/primer/#{name.underscore}_preview.rb" + path_with_component = "previews/primer/#{name.underscore}_component_preview.rb" + File.exist?(path_with_component) ? path_with_component : path + end end def preview_path_with_status @@ -221,6 +244,10 @@ class ComponentStatusMigrator < Thor::Group @status_module ||= "#{class_status}::" unless stable? end + def status_full_path + @status_full_path ||= "app/components/primer/#{status_folder_name}" + end + def template_path @template_path ||= "app/components/primer/#{name.underscore}.html.erb" end From e7727623d78beaa862d88b0ba265fc4c84bf7e22 Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Wed, 7 Dec 2022 13:32:33 -0600 Subject: [PATCH 02/18] deprecate LocalTime in favor of Beta::RelativeTime --- app/components/primer/local_time.rb | 2 ++ lib/primer/deprecations.yml | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/app/components/primer/local_time.rb b/app/components/primer/local_time.rb index cb6c83d630..fe12bff174 100644 --- a/app/components/primer/local_time.rb +++ b/app/components/primer/local_time.rb @@ -3,6 +3,8 @@ module Primer # Use `LocalTime` to format a date and time in the user's preferred locale format. This component requires JavaScript. class LocalTime < Primer::Component + status :deprecated + DEFAULT_DIGIT_TYPE = :numeric DIGIT_TYPE_OPTIONS = [DEFAULT_DIGIT_TYPE, :"2-digit"].freeze diff --git a/lib/primer/deprecations.yml b/lib/primer/deprecations.yml index ebfbcaa6cc..b9b67e5e6c 100644 --- a/lib/primer/deprecations.yml +++ b/lib/primer/deprecations.yml @@ -55,6 +55,11 @@ deprecations: autocorrect: true replacement: "Primer::Beta::Label" + - component: "Primer::LocalTime" + autocorrect: false + replacement: "Primer::Beta::RelativeTime" + guide: "https://primer.style/view-components/guides/primer_local_time" + - component: "Primer::LinkComponent" autocorrect: true replacement: "Primer::Beta::Link" From 1d4dee16a3249560980bad02e3125938176a8390 Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Wed, 7 Dec 2022 13:33:06 -0600 Subject: [PATCH 03/18] added changeset --- .changeset/long-ears-sniff.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/long-ears-sniff.md diff --git a/.changeset/long-ears-sniff.md b/.changeset/long-ears-sniff.md new file mode 100644 index 0000000000..0620fce7d0 --- /dev/null +++ b/.changeset/long-ears-sniff.md @@ -0,0 +1,5 @@ +--- +'@primer/view-components': patch +--- + +Deprecate Primer::LocalTime in favor of Primer::RelativeTime From bead9b609186cd6caa103aff3358dff5841cfecf Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Wed, 7 Dec 2022 13:38:07 -0600 Subject: [PATCH 04/18] rebuild arguments file --- static/arguments.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/arguments.json b/static/arguments.json index 25ef188221..84819caefe 100644 --- a/static/arguments.json +++ b/static/arguments.json @@ -2163,7 +2163,7 @@ }, { "component": "LocalTime", - "status": "alpha", + "status": "deprecated", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/local_time.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/local_time/default/", "parameters": [ From ae092429772e5c4fb2a5fcdab16a460a9eee7460 Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Wed, 7 Dec 2022 13:38:34 -0600 Subject: [PATCH 05/18] update status json file --- static/statuses.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/statuses.json b/static/statuses.json index 7df7cb59fc..e2ec1fcdbc 100644 --- a/static/statuses.json +++ b/static/statuses.json @@ -77,7 +77,7 @@ "Primer::LabelComponent": "deprecated", "Primer::LayoutComponent": "alpha", "Primer::LinkComponent": "deprecated", - "Primer::LocalTime": "alpha", + "Primer::LocalTime": "deprecated", "Primer::Markdown": "deprecated", "Primer::MenuComponent": "alpha", "Primer::Navigation::TabComponent": "alpha", From 495d3b415874bc4bbf485cf916a14642f8a0b3cf Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Wed, 7 Dec 2022 13:41:14 -0600 Subject: [PATCH 06/18] move localtime to deprecated list, in site menu --- docs/src/@primer/gatsby-theme-doctocat/nav.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/@primer/gatsby-theme-doctocat/nav.yml b/docs/src/@primer/gatsby-theme-doctocat/nav.yml index 7380e342c7..339c04c262 100644 --- a/docs/src/@primer/gatsby-theme-doctocat/nav.yml +++ b/docs/src/@primer/gatsby-theme-doctocat/nav.yml @@ -69,8 +69,6 @@ url: "/components/alpha/layout" - title: Link url: "/components/beta/link" - - title: LocalTime - url: "/components/localtime" - title: Markdown url: "/components/beta/markdown" - title: Menu @@ -129,6 +127,8 @@ url: "/components/button" - title: DropdownMenuComponent url: "/components/dropdownmenu" + - title: LocalTime + url: "/components/localtime" - title: IconButton url: "/components/iconbutton" - title: Tooltip From 8e625890b6bd898192d7602923dc897b05ba5a56 Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Wed, 7 Dec 2022 13:46:48 -0600 Subject: [PATCH 07/18] added shell of guide to migrate from localtime to relativetime --- docs/content/guides/primer_local_time.md | 32 ++++++++++++++++++++++++ docs/content/migration.md | 1 + 2 files changed, 33 insertions(+) create mode 100644 docs/content/guides/primer_local_time.md diff --git a/docs/content/guides/primer_local_time.md b/docs/content/guides/primer_local_time.md new file mode 100644 index 0000000000..10e6eeb667 --- /dev/null +++ b/docs/content/guides/primer_local_time.md @@ -0,0 +1,32 @@ +--- +title: Moving Away From `Primer::LocalTime` +--- + +This guide will show you how to upgrade from the now deprecated +[`Primer::LocalTime`](https://primer.style/view-components/components/localtime) +to the latest [`Primer::Beta::RelativeTime`](https://primer.style/view-components/components/beta/relativetime) +component. + +## Arguments + +The following arguments are different between `LocalTime` and `RelativeTime`. + +| From `Primer::LocalTime` | To `Primer::Beta::RelativeTime` | Notes | +|--------------------------|---------------------------------|-------| +| | | | + +Please see the following documentation for complete descriptions and examples. + +* [Deprecated `Primer::LocalTime`](https://primer.style/view-components/components/localtime) +* [`Primer::Beta::RelativeTime` component](https://primer.style/view-components/components/beta/relativetime) +* [`Primer::Beta::RelativeTime` Lookbook examples](https://primer.style/view-components/lookbook/inspect/primer/beta/relativetime/default) + +## Slot Names + +The following slots have changed with the newer Primer Dropdown. + +| From `Primer::LocalTime` | To `Primer::Beta::RelativeTime` | Notes | +|--------------------------|---------------------------------|-------| +| | | | + +[← Back to migration guides](https://primer.style/view-components/migration) diff --git a/docs/content/migration.md b/docs/content/migration.md index 854a4e56bc..fd1a22cff7 100644 --- a/docs/content/migration.md +++ b/docs/content/migration.md @@ -29,3 +29,4 @@ components. |----------------------|-----------------------|-------| | [`Primer::ButtonComponent`](https://primer.style/view-components/components/button) | [`Primer::Beta::Button`](https://primer.style/view-components/components/beta/button) | [Upgrade to Primer::Beta::Button](https://primer.style/view-components/guides/primer_button_component) | | [`Primer::DropdownMenuComponent`](https://primer.style/view-components/components/dropdownmenu) | [`Primer::Alpha::Dropdown`](https://primer.style/view-components/components/alpha/dropdown) | [Upgrade to Primer::Alpha::Dropdown](https://primer.style/view-components/guides/primer_dropdown_menu_component) | +| [`Primer::LocalTime`](https://primer.style/view-components/components/localtime) | [`Primer::Beta::RelativeTime`](https://primer.style/view-components/components/beta/relativetime) | [Upgrade to Primer::Beta::RelativeTime](https://primer.style/view-components/guides/primer_local_time) | From f3afccc38bf8ab89de0ce8f4d22bf16bf17b438a Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Wed, 7 Dec 2022 13:58:35 -0600 Subject: [PATCH 08/18] fixed the order of deprecated components --- docs/src/@primer/gatsby-theme-doctocat/nav.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/@primer/gatsby-theme-doctocat/nav.yml b/docs/src/@primer/gatsby-theme-doctocat/nav.yml index 339c04c262..e68b818043 100644 --- a/docs/src/@primer/gatsby-theme-doctocat/nav.yml +++ b/docs/src/@primer/gatsby-theme-doctocat/nav.yml @@ -127,10 +127,10 @@ url: "/components/button" - title: DropdownMenuComponent url: "/components/dropdownmenu" - - title: LocalTime - url: "/components/localtime" - title: IconButton url: "/components/iconbutton" + - title: LocalTime + url: "/components/localtime" - title: Tooltip url: "/components/tooltip" - title: Architecture decisions From 696063c8c32dc39a39fab10f3a69335ec6503f9f Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Wed, 7 Dec 2022 15:54:27 -0600 Subject: [PATCH 09/18] finished first draft of local time to relative time guide --- docs/content/guides/primer_local_time.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/content/guides/primer_local_time.md b/docs/content/guides/primer_local_time.md index 10e6eeb667..0cb2e1e2c8 100644 --- a/docs/content/guides/primer_local_time.md +++ b/docs/content/guides/primer_local_time.md @@ -13,7 +13,16 @@ The following arguments are different between `LocalTime` and `RelativeTime`. | From `Primer::LocalTime` | To `Primer::Beta::RelativeTime` | Notes | |--------------------------|---------------------------------|-------| -| | | | +| `initial_text` | n/a | No longer used. | +| n/a | `tense` | Which tense to use. One of `:auto`, `:future`, or `:past`. | +| n/a | `prefix` | What to prefix the relative ime display with. | +| n/a | `threshold` | The threshold at which relative time displays become absolute. | +| n/a | `precision` | The precision elapsed time should display. One of nil, `:day`, `:hour`, `:minute`, `:month`, `:second`, or `:year`. | +| n/a | `format` | The format the display should take. One of `:auto`, `:elapsed`, or `:micro`. | +| n/a | `lang` | The language to use. | +| n/a | `title` | Provide a custom title to the element. | + +The remaining arguments stayed the same. Please see the following documentation for complete descriptions and examples. @@ -21,12 +30,4 @@ Please see the following documentation for complete descriptions and examples. * [`Primer::Beta::RelativeTime` component](https://primer.style/view-components/components/beta/relativetime) * [`Primer::Beta::RelativeTime` Lookbook examples](https://primer.style/view-components/lookbook/inspect/primer/beta/relativetime/default) -## Slot Names - -The following slots have changed with the newer Primer Dropdown. - -| From `Primer::LocalTime` | To `Primer::Beta::RelativeTime` | Notes | -|--------------------------|---------------------------------|-------| -| | | | - [← Back to migration guides](https://primer.style/view-components/migration) From cea996c04a31981e0ac4056e272d2f6e4e320080 Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Wed, 7 Dec 2022 16:14:34 -0600 Subject: [PATCH 10/18] added p tag with nonbreaking space to fix spacing issue --- docs/content/guides/primer_local_time.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/content/guides/primer_local_time.md b/docs/content/guides/primer_local_time.md index 0cb2e1e2c8..87489fac10 100644 --- a/docs/content/guides/primer_local_time.md +++ b/docs/content/guides/primer_local_time.md @@ -30,4 +30,6 @@ Please see the following documentation for complete descriptions and examples. * [`Primer::Beta::RelativeTime` component](https://primer.style/view-components/components/beta/relativetime) * [`Primer::Beta::RelativeTime` Lookbook examples](https://primer.style/view-components/lookbook/inspect/primer/beta/relativetime/default) +

 

+ [← Back to migration guides](https://primer.style/view-components/migration) From 797e0641a77794fac9fb6d49622eda75d41371ca Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Thu, 8 Dec 2022 11:44:24 -0600 Subject: [PATCH 11/18] added example of basic migration, with explanation of what a threshold is --- app/components/primer/beta/relative_time.rb | 2 +- docs/content/guides/primer_local_time.md | 30 ++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/app/components/primer/beta/relative_time.rb b/app/components/primer/beta/relative_time.rb index 6ba9a0bbdf..da49c7bb3f 100644 --- a/app/components/primer/beta/relative_time.rb +++ b/app/components/primer/beta/relative_time.rb @@ -101,7 +101,7 @@ class RelativeTime < Primer::Component # @param month [Symbol] What format months should take. <%= one_of(Primer::Beta::RelativeTime::MONTH_OPTIONS) %> # @param year [Symbol] What format years should take. <%= one_of(Primer::Beta::RelativeTime::YEAR_OPTIONS) %> # @param time_zone_name [Symbol] What format the time zone should take. <%= one_of(Primer::Beta::RelativeTime::TIMEZONENAME_OPTIONS) %> - # @param threshold [string] The threshold at which relative time displays become absolute. + # @param threshold [string] The threshold, in ISO-8601 'durations' format, at which relative time displays become absolute. # @param precision [Symbol] The precision elapsed time should display. <%= one_of(Primer::Beta::RelativeTime::PRECISION_OPTIONS) %> # @param format [Symbol] The format the display should take. <%= one_of(Primer::Beta::RelativeTime::FORMAT_OPTIONS) %> # @param lang [string] The language to use. diff --git a/docs/content/guides/primer_local_time.md b/docs/content/guides/primer_local_time.md index 87489fac10..802c149d6f 100644 --- a/docs/content/guides/primer_local_time.md +++ b/docs/content/guides/primer_local_time.md @@ -7,6 +7,34 @@ This guide will show you how to upgrade from the now deprecated to the latest [`Primer::Beta::RelativeTime`](https://primer.style/view-components/components/beta/relativetime) component. +## A Migration Example + +The most common use case of the `LocalTime` component can be migrated with only +a few minor changes. + +For example, if the `LocalTime` was set up in this way: + +```rb +<%= Primer::LocalTime(datetime: Time.now, initial_text: Time.now.iso8601) %> +``` + +It can be migrated and removing `initial_text` and setting an empty `prefix`. + +```rb +<%= Primer::Beta::RelativeTtime(datetime: Time.now, prefix: "", threshold: "PT0S") %> +``` + +The `RelativeTime` component defaults to the `iso8601` format, so there's no need to +specify that format. + +The `threshold` value is an [ISO-8601 "duration"](https://en.wikipedia.org/wiki/ISO_8601#Durations) that tells the `RelativeTime` +component to display the absolute date/time, instead of relative time +description. The example of `PT0S` says to switch to absolute time display +starting zero (0) seconds ago. In practice, this means it will always display +the absolute time. With the `LocalTime` component, `PT0S` was the default +threshold. The `RelativeTime` component does not have a default, however, and +it should should be specified if needed. + ## Arguments The following arguments are different between `LocalTime` and `RelativeTime`. @@ -16,7 +44,7 @@ The following arguments are different between `LocalTime` and `RelativeTime`. | `initial_text` | n/a | No longer used. | | n/a | `tense` | Which tense to use. One of `:auto`, `:future`, or `:past`. | | n/a | `prefix` | What to prefix the relative ime display with. | -| n/a | `threshold` | The threshold at which relative time displays become absolute. | +| n/a | `threshold` | The threshold, in ISO-8601 'durations' format, at which relative time displays become absolute. | | n/a | `precision` | The precision elapsed time should display. One of nil, `:day`, `:hour`, `:minute`, `:month`, `:second`, or `:year`. | | n/a | `format` | The format the display should take. One of `:auto`, `:elapsed`, or `:micro`. | | n/a | `lang` | The language to use. | From c5231734a1fac41341874b2fdacf1d9488c2b4bf Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Thu, 8 Dec 2022 11:51:57 -0600 Subject: [PATCH 12/18] rebuild arguments.json --- static/arguments.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/arguments.json b/static/arguments.json index a02de39c84..af7e42e06e 100644 --- a/static/arguments.json +++ b/static/arguments.json @@ -1885,7 +1885,7 @@ "name": "threshold", "type": "string", "default": "`nil`", - "description": "The threshold at which relative time displays become absolute." + "description": "The threshold, in ISO-8601 'durations' format, at which relative time displays become absolute." }, { "name": "precision", From aebb79fb5449d48b265b48664ed0f1e137462c5d Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Thu, 8 Dec 2022 11:57:58 -0600 Subject: [PATCH 13/18] small adjustment to language in migration example --- docs/content/guides/primer_local_time.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/guides/primer_local_time.md b/docs/content/guides/primer_local_time.md index 802c149d6f..9f6407911a 100644 --- a/docs/content/guides/primer_local_time.md +++ b/docs/content/guides/primer_local_time.md @@ -24,8 +24,8 @@ It can be migrated and removing `initial_text` and setting an empty `prefix`. <%= Primer::Beta::RelativeTtime(datetime: Time.now, prefix: "", threshold: "PT0S") %> ``` -The `RelativeTime` component defaults to the `iso8601` format, so there's no need to -specify that format. +The `RelativeTime` component defaults to the `iso8601` format and does not need +to be specified directly. The `threshold` value is an [ISO-8601 "duration"](https://en.wikipedia.org/wiki/ISO_8601#Durations) that tells the `RelativeTime` component to display the absolute date/time, instead of relative time From 9b1fc9a211090edcefa83a6240510f992a677098 Mon Sep 17 00:00:00 2001 From: River Lynn Bailey Date: Thu, 8 Dec 2022 12:01:18 -0600 Subject: [PATCH 14/18] Update docs/content/guides/primer_local_time.md Co-authored-by: Jon Rohan --- docs/content/guides/primer_local_time.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/guides/primer_local_time.md b/docs/content/guides/primer_local_time.md index 9f6407911a..48de03707a 100644 --- a/docs/content/guides/primer_local_time.md +++ b/docs/content/guides/primer_local_time.md @@ -21,7 +21,7 @@ For example, if the `LocalTime` was set up in this way: It can be migrated and removing `initial_text` and setting an empty `prefix`. ```rb -<%= Primer::Beta::RelativeTtime(datetime: Time.now, prefix: "", threshold: "PT0S") %> +<%= Primer::Beta::RelativeTime(datetime: Time.now, prefix: "", threshold: "PT0S") %> ``` The `RelativeTime` component defaults to the `iso8601` format and does not need From 6c0aff7c941c06d24edb0772807444af74f0c3ea Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Thu, 8 Dec 2022 12:03:09 -0600 Subject: [PATCH 15/18] clean up trailing spaces --- docs/content/guides/primer_local_time.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/guides/primer_local_time.md b/docs/content/guides/primer_local_time.md index 9f6407911a..8c6b58ff2c 100644 --- a/docs/content/guides/primer_local_time.md +++ b/docs/content/guides/primer_local_time.md @@ -10,7 +10,7 @@ component. ## A Migration Example The most common use case of the `LocalTime` component can be migrated with only -a few minor changes. +a few minor changes. For example, if the `LocalTime` was set up in this way: @@ -18,14 +18,14 @@ For example, if the `LocalTime` was set up in this way: <%= Primer::LocalTime(datetime: Time.now, initial_text: Time.now.iso8601) %> ``` -It can be migrated and removing `initial_text` and setting an empty `prefix`. +It can be migrated and removing `initial_text` and setting an empty `prefix`. ```rb <%= Primer::Beta::RelativeTtime(datetime: Time.now, prefix: "", threshold: "PT0S") %> ``` The `RelativeTime` component defaults to the `iso8601` format and does not need -to be specified directly. +to be specified directly. The `threshold` value is an [ISO-8601 "duration"](https://en.wikipedia.org/wiki/ISO_8601#Durations) that tells the `RelativeTime` component to display the absolute date/time, instead of relative time From dccd915fda5dd4218cac9c85fc5c1cd2e5916205 Mon Sep 17 00:00:00 2001 From: River Lynn Bailey Date: Thu, 8 Dec 2022 12:19:49 -0600 Subject: [PATCH 16/18] Update docs/content/guides/primer_local_time.md Co-authored-by: Keith Cirkel --- docs/content/guides/primer_local_time.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/guides/primer_local_time.md b/docs/content/guides/primer_local_time.md index 022492a4fd..e3c4eff0ee 100644 --- a/docs/content/guides/primer_local_time.md +++ b/docs/content/guides/primer_local_time.md @@ -18,7 +18,7 @@ For example, if the `LocalTime` was set up in this way: <%= Primer::LocalTime(datetime: Time.now, initial_text: Time.now.iso8601) %> ``` -It can be migrated and removing `initial_text` and setting an empty `prefix`. +It can be migrated and removing `initial_text` and setting an empty `prefix` and `threshold: "PT0S"`. ```rb <%= Primer::Beta::RelativeTime(datetime: Time.now, prefix: "", threshold: "PT0S") %> From db146c6a31863f54c871c601fd5487c803f185e1 Mon Sep 17 00:00:00 2001 From: River Lynn Bailey Date: Thu, 8 Dec 2022 12:21:00 -0600 Subject: [PATCH 17/18] Update docs/content/guides/primer_local_time.md Co-authored-by: Keith Cirkel --- docs/content/guides/primer_local_time.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/guides/primer_local_time.md b/docs/content/guides/primer_local_time.md index e3c4eff0ee..14ffa92e35 100644 --- a/docs/content/guides/primer_local_time.md +++ b/docs/content/guides/primer_local_time.md @@ -32,8 +32,8 @@ component to display the absolute date/time, instead of relative time description. The example of `PT0S` says to switch to absolute time display starting zero (0) seconds ago. In practice, this means it will always display the absolute time. With the `LocalTime` component, `PT0S` was the default -threshold. The `RelativeTime` component does not have a default, however, and -it should should be specified if needed. +threshold. The `RelativeTime` component defaults to `P30D`, however, and +it will need to be zeroed out to always display a datetime. ## Arguments From 8e5153a7ef78a78d44207ba944e302af2e9602d3 Mon Sep 17 00:00:00 2001 From: River Lynn Parrhesia Bailey Date: Thu, 8 Dec 2022 13:25:02 -0600 Subject: [PATCH 18/18] minor language adjustment --- docs/content/guides/primer_local_time.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/guides/primer_local_time.md b/docs/content/guides/primer_local_time.md index 14ffa92e35..198602b6db 100644 --- a/docs/content/guides/primer_local_time.md +++ b/docs/content/guides/primer_local_time.md @@ -18,7 +18,7 @@ For example, if the `LocalTime` was set up in this way: <%= Primer::LocalTime(datetime: Time.now, initial_text: Time.now.iso8601) %> ``` -It can be migrated and removing `initial_text` and setting an empty `prefix` and `threshold: "PT0S"`. +It can be migrated by removing `initial_text`c, setting an empty `prefix`, and adding `threshold: "PT0S"`. ```rb <%= Primer::Beta::RelativeTime(datetime: Time.now, prefix: "", threshold: "PT0S") %>