From 3c61f313efe6403e9995d30b796cc3105cd190ef Mon Sep 17 00:00:00 2001
From: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>
Date: Tue, 18 Apr 2023 09:30:34 -0600
Subject: [PATCH 1/2] fix typo (#24695)
---
web/packages/design/src/Icon/Icon.jsx | 2 +-
web/packages/design/src/Icon/Icon.story.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/packages/design/src/Icon/Icon.jsx b/web/packages/design/src/Icon/Icon.jsx
index 7ed016b752446..81814a593f9d1 100644
--- a/web/packages/design/src/Icon/Icon.jsx
+++ b/web/packages/design/src/Icon/Icon.jsx
@@ -75,6 +75,7 @@ export const ChatBubble = makeFontIcon(
'ChatBubble',
'icon-chat_bubble_outline'
);
+export const Chart = makeFontIcon('Chart', 'icon-chart-bars');
export const Check = makeFontIcon('Check', 'icon-check');
export const ChevronCircleDown = makeFontIcon(
'ChevronCircleDown',
@@ -233,7 +234,6 @@ export const SettingsOverscan = makeFontIcon(
'icon-settings_overscan'
);
export const Share = makeFontIcon('Share', 'icon-share');
-export const Shart = makeFontIcon('Shart', 'icon-chart-bars');
export const ShieldCheck = makeFontIcon('ShieldCheck', 'icon-shield-check');
export const Shrink = makeFontIcon('Shrink', 'icon-shrink');
export const SmallArrowDown = makeFontIcon(
diff --git a/web/packages/design/src/Icon/Icon.story.js b/web/packages/design/src/Icon/Icon.story.js
index a0d3da83674ed..650176c1fd687 100644
--- a/web/packages/design/src/Icon/Icon.story.js
+++ b/web/packages/design/src/Icon/Icon.story.js
@@ -58,6 +58,7 @@ export const ListOfIcons = () => (
+
@@ -164,7 +165,6 @@ export const ListOfIcons = () => (
/>
-
From a8c31d9f038e7c560e754a1f5af313c4aa8f31d0 Mon Sep 17 00:00:00 2001
From: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>
Date: Fri, 21 Apr 2023 11:16:58 -0600
Subject: [PATCH 2/2] Adds dependencies for teleport/e #1135 (#24574)
- Adds helper methods for formatting dates
- Adds stripe dependencies to yarn lock
---
web/packages/shared/config.js | 2 +-
web/packages/shared/services/loc/loc.ts | 16 ++++++++++++++++
yarn.lock | 12 ++++++++++++
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/web/packages/shared/config.js b/web/packages/shared/config.js
index 1e7d1a14cbb83..adb15ff9f0eac 100644
--- a/web/packages/shared/config.js
+++ b/web/packages/shared/config.js
@@ -16,8 +16,8 @@ limitations under the License.
const cfg = {
dateTimeFormat: 'yyyy-MM-dd HH:mm:ss',
-
dateFormat: 'yyyy-MM-dd',
+ shortFormat: 'MMM dd, yyyy',
};
export default cfg;
diff --git a/web/packages/shared/services/loc/loc.ts b/web/packages/shared/services/loc/loc.ts
index ffb300b054150..859fede8e82c4 100644
--- a/web/packages/shared/services/loc/loc.ts
+++ b/web/packages/shared/services/loc/loc.ts
@@ -23,6 +23,7 @@ const isTest = process.env.NODE_ENV === 'test';
const logger = Logger.create('services/loc');
+// displayUnixDate accepts a unix timestamp and returns formatted as 'yyyy-MM-dd'
export function displayUnixDate(seconds: number) {
// Multiply by 1000 b/c date constructor expects milliseconds.
const date = new Date(seconds * 1000);
@@ -30,6 +31,7 @@ export function displayUnixDate(seconds: number) {
return displayDate(date);
}
+// displayDate accepts a date and returns formatted as 'yyyy-MM-dd'
export function displayDate(date: Date) {
try {
if (isTest) {
@@ -42,6 +44,20 @@ export function displayDate(date: Date) {
}
}
+// displayShortDate accepts a date and returns formatted as 'MM dd, yyyy'
+export function displayShortDate(date: Date) {
+ try {
+ if (isTest) {
+ return format(dateToUtc(date), cfg.shortFormat);
+ }
+ return format(date, cfg.shortFormat);
+ } catch (err) {
+ logger.error('displayDate()', err);
+ return 'undefined';
+ }
+}
+
+// displayDateTime accepts a date and returns formatted as 'yyyy-MM-dd HH:mm:ss'
export function displayDateTime(date: Date) {
try {
if (isTest) {
diff --git a/yarn.lock b/yarn.lock
index 06ee865439b67..ba6817e0f26ba 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3112,6 +3112,18 @@
regenerator-runtime "^0.13.7"
resolve-from "^5.0.0"
+"@stripe/react-stripe-js@^1.16.5":
+ version "1.16.5"
+ resolved "https://registry.yarnpkg.com/@stripe/react-stripe-js/-/react-stripe-js-1.16.5.tgz#51cf862b50ca91ae6193c77a5bec889e81047f10"
+ integrity sha512-lVPW3IfwdacyS22pP+nBB6/GNFRRhT/4jfgAK6T2guQmtzPwJV1DogiGGaBNhiKtSY18+yS8KlHSu+PvZNclvQ==
+ dependencies:
+ prop-types "^15.7.2"
+
+"@stripe/stripe-js@^1.48.0":
+ version "1.52.1"
+ resolved "https://registry.yarnpkg.com/@stripe/stripe-js/-/stripe-js-1.52.1.tgz#d821bcd627a34227c20fe87d7c8f8bd4386eaf2e"
+ integrity sha512-fza40OPSpGQlFxc5TZWiYC/6Lk89Sep1fLuv9ss33YS6lCAF8UZbfA1E6W+lwO4c7WRKZIZumHIEbPJfP/O9uw==
+
"@swc/core-darwin-arm64@1.3.36":
version "1.3.36"
resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.36.tgz#37f15d0edda0e78837bdab337d69777d2fecfa40"