aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/intl
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2019-12-19 10:58:37 +0100
committerSonarTech <sonartech@sonarsource.com>2020-02-10 20:46:15 +0100
commit822405efd0ddde6b1e123c40cc1255e9b57c05f8 (patch)
tree5896c4f40e0240c563f48370b90b2450a0a061a8 /server/sonar-web/src/main/js/components/intl
parent914f3a4e69b2d5896bf71e71ee63f45d45303efe (diff)
downloadsonarqube-822405efd0ddde6b1e123c40cc1255e9b57c05f8.tar.gz
sonarqube-822405efd0ddde6b1e123c40cc1255e9b57c05f8.zip
SONAR-12632 SONAR-12678 Implement new Overview layout
Diffstat (limited to 'server/sonar-web/src/main/js/components/intl')
-rw-r--r--server/sonar-web/src/main/js/components/intl/__mocks__/DateFromNow.tsx30
1 files changed, 30 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/components/intl/__mocks__/DateFromNow.tsx b/server/sonar-web/src/main/js/components/intl/__mocks__/DateFromNow.tsx
new file mode 100644
index 00000000000..762fcb26a48
--- /dev/null
+++ b/server/sonar-web/src/main/js/components/intl/__mocks__/DateFromNow.tsx
@@ -0,0 +1,30 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { DateSource } from 'react-intl';
+
+interface Props {
+ children?: (formattedDate: string) => React.ReactNode;
+ date: DateSource;
+}
+
+export default function DateFromNow({ children, date }: Props) {
+ return children && children(date.toString());
+}