diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/itunes/src/App.js b/itunes/src/App.js
index de69f72..1223646 100644
--- a/itunes/src/App.js
+++ b/itunes/src/App.js
@@ -26,7 +26,20 @@ const MediaContainer = (props) => {
//console.log(setPreview+","+sourceUrl)
setPreview(sourceUrl);
}
+ function formatDate(date) {
+ var d = new Date(date),
+ month = '' + (d.getMonth() + 1),
+ day = '' + d.getDate(),
+ year = d.getFullYear();
+ if (month.length < 2)
+ month = '0' + month;
+ if (day.length < 2)
+ day = '0' + day;
+
+ return [year, month, day].join('-');
+ }
+
return (
{props.data.map((media, counter) =>
@@ -35,7 +48,9 @@ const MediaContainer = (props) => {
{media.trackName}
- {media.artistName} : {media.collectionName}
+ {media.artistName} : {media.collectionName}
+
${media.trackPrice}
{media.longDescription}
+
@@ -83,7 +98,7 @@ const App = () => {
0)?currentData.filter((song)=>{
- return (song.trackName.toLowerCase().includes(searchQuery.toLowerCase())||song.collectionName.toLowerCase().includes(searchQuery.toLowerCase())||song.artistName.toLowerCase().includes(searchQuery.toLowerCase()))
+ return (song.trackName && song.trackName.toLowerCase().includes(searchQuery.toLowerCase())||song.collectionName && song.collectionName.toLowerCase().includes(searchQuery.toLowerCase())||song.artistName && song.artistName.toLowerCase().includes(searchQuery.toLowerCase()))
}):currentData} setPreview={setPreview}/>