Просмотр исходного кода

Merge branch 'master' into feat/4572-get-contributors-with-gc-api

ryohi15 5 лет назад
Родитель
Сommit
960cc6b69d
3 измененных файлов с 13 добавлено и 6 удалено
  1. 1 1
      CHANGES.md
  2. 6 5
      src/client/js/components/Navbar/AuthorInfo.jsx
  3. 6 0
      src/server/service/config-loader.js

+ 1 - 1
CHANGES.md

@@ -2,7 +2,7 @@
 
 
 ## v4.2.8-RC
 ## v4.2.8-RC
 
 
-* 
+* Fix: Fixed the display of updtedAt and createdAt being reversed 
 
 
 ## v4.2.7
 ## v4.2.7
 
 

+ 6 - 5
src/client/js/components/Navbar/AuthorInfo.jsx

@@ -1,10 +1,11 @@
 import React from 'react';
 import React from 'react';
 import PropTypes from 'prop-types';
 import PropTypes from 'prop-types';
-
 import { userPageRoot } from '@commons/util/path-utils';
 import { userPageRoot } from '@commons/util/path-utils';
+import { format } from 'date-fns';
 
 
 import UserPicture from '../User/UserPicture';
 import UserPicture from '../User/UserPicture';
 
 
+const formatType = 'yyyy/MM/dd HH:mm';
 const AuthorInfo = (props) => {
 const AuthorInfo = (props) => {
   const {
   const {
     mode, user, date, locate,
     mode, user, date, locate,
@@ -14,14 +15,14 @@ const AuthorInfo = (props) => {
     ? 'Created by'
     ? 'Created by'
     : 'Updated by';
     : 'Updated by';
   const infoLabelForFooter = mode === 'create'
   const infoLabelForFooter = mode === 'create'
-    ? 'Last revision posted at'
-    : 'Created at';
+    ? 'Created at'
+    : 'Last revision posted at';
   const userLabel = user != null
   const userLabel = user != null
     ? <a href={userPageRoot(user)}>{user.name}</a>
     ? <a href={userPageRoot(user)}>{user.name}</a>
     : <i>Unknown</i>;
     : <i>Unknown</i>;
 
 
   if (locate === 'footer') {
   if (locate === 'footer') {
-    return <p>{infoLabelForFooter} {date} by <UserPicture user={user} size="sm" /> {userLabel}</p>;
+    return <p>{infoLabelForFooter} {format(new Date(date), formatType)} by <UserPicture user={user} size="sm" /> {userLabel}</p>;
   }
   }
 
 
   return (
   return (
@@ -31,7 +32,7 @@ const AuthorInfo = (props) => {
       </div>
       </div>
       <div>
       <div>
         <div>{infoLabelForSubNav} {userLabel}</div>
         <div>{infoLabelForSubNav} {userLabel}</div>
-        <div className="text-muted text-date">{date}</div>
+        <div className="text-muted text-date">{format(new Date(date), formatType)}</div>
       </div>
       </div>
     </div>
     </div>
   );
   );

+ 6 - 0
src/server/service/config-loader.js

@@ -392,6 +392,12 @@ const ENV_VAR_NAME_TO_CONFIG_INFO = {
     type:    TYPES.NUMBER,
     type:    TYPES.NUMBER,
     default: 7788,
     default: 7788,
   },
   },
+  GROWI_CLOUD_URI: {
+    ns:      'crowi',
+    key:     'app:growiCloudUri',
+    type:    TYPES.STRING,
+    default: null,
+  },
 };
 };
 
 
 class ConfigLoader {
 class ConfigLoader {