sit79 / iggy-confidential-tracklist-scraper

Retrieve all titles from Iggy Pop's current playlist on the BBC.
0 stars 0 forks source link

Implement proper date() object #6

Open sit79 opened 2 years ago

sit79 commented 2 years ago

Is your feature request related to a problem? Please describe. The date string in the saved txt files makes sorting files by name hard to use. Instead of '2022-Jan-02' it would be better to use '2022-01-02' in the file name.

Describe the solution you'd like Instead of just copying the date string ('2022-Jan-02') from the scraped page, use new Date('2022-Jan-02') to create a proper date object. Then use that object to construct the desired string ('2022-01-02') for the file name.

Additional context Future versions of this scraper will write the scraped data to a MongoDB database instead of text files. A proper date object is therefore desirable.