Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
#8 used const variable for the date format
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshbhingaradiya committed Aug 25, 2021
1 parent 8cd3c6b commit a96f9cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions screens/EventScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import ToggleNavigationButton from '../components/ToggleNavigationButton';

const Stack = createStackNavigator();

const dateFormat = 'M-D-YY h:m:s A';

function Player({uri}) {
const [error, setError] = useState(false);
const [stopped, setStopped] = useState(false);
Expand All @@ -44,7 +46,7 @@ function EventButton({id, title, published, updated, active, current}) {
marginTop: 5, paddingLeft: 10, paddingRight: 10, paddingTop:15,
paddingBottom:15}}>
<View><Text style={{color: active ? 'white' : '#777777'}}>{title}</Text></View>
{updated ? <View><Text style={{color: active ? 'white' : '#777777'}}>Updated: {dayJs(updated).format('M-D-YY h:m:s A')}</Text></View> :
{updated ? <View><Text style={{color: active ? 'white' : '#777777'}}>Updated: {dayJs(updated).format(dateFormat)}</Text></View> :
(published ? <View><Text style={{color: active ? 'white' : '#777777'}}>Published: {published}</Text></View> : null)}
</View>);
}
Expand All @@ -60,7 +62,7 @@ function EventList({navigation}) {
setRefreshing(true);
getEvents(getAddressByCredentials(state.activeAccount)).then(([list, update]) => {
setEventList(list);
setLastUpdate(dayJs(update).format('M-D-YY h:m:s A'));
setLastUpdate(dayJs(update).format(dateFormat));
setRefreshing(false);
});
}, [state.activeAccount]);
Expand Down

0 comments on commit a96f9cd

Please sign in to comment.