Skip to content

Commit

Permalink
add all
Browse files Browse the repository at this point in the history
  • Loading branch information
leonalkalai committed Mar 15, 2024
1 parent efcc6e4 commit 0d5a641
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/components/TwitterClone/DateComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ It's telling the method to format the day as a two-digit number and the month as
import PropTypes from 'prop-types';

DateComponent.propTypes = {
publishDate:PropTypes.instanceOf(Date)
publishDate:PropTypes.string.isRequired,
}

export default function DateComponent(props){
const options = { day: '2-digit', month: 'long' };
// Parse the date string to a Date object
const parsedDate = new Date(props.date);

const formattedDate = parsedDate.toLocaleDateString('en-US', { day: '2-digit', month: 'long' });


const options = { day: '2-digit', month: 'long' ,year: 'numeric'};
// Parse the date string to a Date object
const parsedDate = new Date(props.publishDate);

const formattedDate = parsedDate.toLocaleDateString('en-US', options);
return (
<>
{formattedDate}
Expand Down
2 changes: 1 addition & 1 deletion src/components/TwitterClone/FollowerComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ FollowerComponent.propTypes = {
name:PropTypes.string.isRequired,
profileImage:PropTypes.string.isRequired,
userName:PropTypes.string.isRequired,
publishDate:PropTypes.string.isRequired,
}


export default function FollowerComponent(props){
return(
<div className="flex flex-shrink-0 p-4 pb-0">
Expand Down
3 changes: 1 addition & 2 deletions src/components/TwitterClone/Tweet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Tweet.propTypes = {
name:PropTypes.string.isRequired,
profileImage:PropTypes.string.isRequired,
userName:PropTypes.string.isRequired,
publishDate:PropTypes.string.isRequired,
uploadedImage:PropTypes.string.isRequired,
text:PropTypes.array.isRequired
}
Expand All @@ -16,7 +15,7 @@ Tweet.propTypes = {
export default function Tweet(props){
return(
<>
<FollowerComponent name={props.name} profileImage={props.profileImage} userName={props.userName}/>
<FollowerComponent name={props.name} profileImage={props.profileImage} userName={props.userName} publishDate={props.publishDate}/>
<div className="pl-16">
<p className="text-base width-auto font-medium text-white flex-shrink">
{props.text}
Expand Down

0 comments on commit 0d5a641

Please sign in to comment.