twindle-co / twindle

Twindle - an open source project for beginners. Converting twitter threads to pdf, epub, and mobi format to be read by Kindle.
https://www.twindle.co
MIT License
134 stars 133 forks source link

CLI user fetch thread created date #771

Closed Proful closed 3 years ago

Proful commented 3 years ago

image Threadcreated:Mar14,2009 This date should be CLI run date.

node . -u dvassallo -n 10

@Mira-Alf you no need to fix this. Let someone new to the codebase fix this.

SarveshKadam commented 3 years ago

@proful Can I work on this issue?

PuruVJ commented 3 years ago

@proful Can I work on this issue?

Anyone is free to jump in and tweak stuff. In fact we encourage it😉

You may wanna look in user_timeline.js somewhere inside Twitter folder. The stuff is there.

SarveshKadam commented 3 years ago

@PuruVJ Do correct me if I'm wrong. I think this is related to hbs templates under the 'renderer' folder. Let me know

PuruVJ commented 3 years ago

@PuruVJ Do correct me if I'm wrong. I think this is related to hbs templates under the 'renderer' folder.

Let me know

The date generation and manipulation happens in the file I started above. You'll find a statement don't datetime formatting. It needs to be changed to the current date.

tr0mbl3y commented 3 years ago

in utils/date.js u have to do this --> const formatTimestamp = () => format(new Date(), "MMM d, yyyy"); this will give current date.

Proful commented 3 years ago

It should be set to today's date only when passing user ID.

No changes when reading threads

tr0mbl3y commented 3 years ago

woops! that i didn't notice let me see

PuruVJ commented 3 years ago

in utils/date.js u have to do this --> const formatTimestamp = () => format(new Date(), "MMM d, yyyy"); this will give current date.

No no! This is a common util function and should stay so. The change needs to happen in user_timeline.js only. formatTimestamp(new Date().toString()) should do it.

tr0mbl3y commented 3 years ago

i made changes in useer-timeline-endpoint.js previous: resp.common.created_at = formatTimestamp(user.created_at); now: resp.common.created_at = formatTimestamp(new Date()); now its working

tr0mbl3y commented 3 years ago

in utils/date.js u have to do this --> const formatTimestamp = () => format(new Date(), "MMM d, yyyy"); this will give current date.

No no! This is a common util function and should stay so. The change needs to happen in user_timeline.js only. formatTimestamp(new Date().toString()) should do it.

yes i realised that i was changing the whole global function which would change dates everywhere

PuruVJ commented 3 years ago

@tr0mbl3y Good work! make your PR, we'll review and merge it.