From 529385bc5b70834bb530d3d2e3c7c6d72037d504 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 30 Jan 2019 20:31:22 +0100 Subject: [PATCH] display publish date on file page --- app/src/component/dateTime/view.js | 5 ++++- app/src/page/file/view.js | 27 ++++++++++++++++++--------- app/src/styles/filePage.js | 16 +++++++++++++--- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/app/src/component/dateTime/view.js b/app/src/component/dateTime/view.js index 0261b81a..47eb5ea1 100644 --- a/app/src/component/dateTime/view.js +++ b/app/src/component/dateTime/view.js @@ -32,12 +32,15 @@ class DateTime extends React.PureComponent { return date ? {moment(date).from(moment())} : null; } + // TODO: formatOptions not working as expected in RN + // date.toLocaleDateString([locale, 'en-US'], formatOptions)} + return ( {date && (show === DateTime.SHOW_BOTH || show === DateTime.SHOW_DATE) && - date.toLocaleDateString([locale, 'en-US'], formatOptions)} + moment(date).format('MMMM D, YYYY')} {show === DateTime.SHOW_BOTH && ' '} {date && (show === DateTime.SHOW_BOTH || show === DateTime.SHOW_TIME) && diff --git a/app/src/page/file/view.js b/app/src/page/file/view.js index 59f605a0..ca4d49c9 100644 --- a/app/src/page/file/view.js +++ b/app/src/page/file/view.js @@ -20,6 +20,7 @@ import ImageViewer from 'react-native-image-zoom-viewer'; import Button from 'component/button'; import Colors from 'styles/colors'; import ChannelPage from 'page/channel'; +import DateTime from 'component/dateTime'; import FileDownloadButton from 'component/fileDownloadButton'; import FileItemMedia from 'component/fileItemMedia'; import FilePrice from 'component/filePrice'; @@ -567,15 +568,23 @@ class FilePage extends React.PureComponent { {title} {channelName && - { - const channelUri = normalizeURI(channelName); - navigateToUri(navigation, channelUri); - }} /> + + { + const channelUri = normalizeURI(channelName); + navigateToUri(navigation, channelUri); + }} /> + +