I am trying to add a news feed for my site but I have an error when I am in my home page and no news feed showing.

date_added in the Date format and not Unix tomestampI have printed my row["date_added"]
From the log :

We should see the newsfeed and not the error.
We can either verify the date format inside the Newsfeed Plugin or add to the documentation that the date format has to be unix.
First fix would be better because the developer would not have to think about it making development easier.
For future information if like me in your db you are not using unix timestamp you can convert it by using doing this : strftime('%s', date_added) AS date_added,
Actually doing what I said before doesn't work because it is going to break the parser...
Look like the parser doesn't like to be given a function with several parameters... The ',' inside the strftime break it and give you the date_added)
I gave up...
I just modified my site so it will register new date at the unix timestamp format...
Hi, some questions:
int skip with a warning?@EibrielInv That is (new Date).toString()
The date format is something like this : 2017-11-26T12:16:57.714Z you can see it in the database under the column date_added in mixtape database.
@EibrielInv Yes, we need to check that the type is an integer or you will need to convert it to unix timestamp.
I also tried to convert it in the sql query doing this strftime('%s', date_added) AS date_added but there is a parser which failed to take the all strftime('%s', date_added) value and only return , date_added) precesely this line https://github.com/HelloZeroNet/ZeroNet/blob/master/src/Db/DbQuery.py#L18
The regexp doesn't undertand that we are in a function and will cut it at the first coma returning , date_added)
I think checking the time format and converting it is actually a good solution for that.
Ok I found a workaround until we do a patch for this :
"CAST(round((julianday(date_added)- 2440587.5)*86400.0) AS integer) AS date_added" <-- for all the people who have done the same mistake as me we can do that.
Still need a patch
Just a quick note on it.
I believe that just fixing this issue by doing a conversion from date format to int won't be enough here : https://github.com/HelloZeroNet/ZeroNet/blob/master/plugins/Newsfeed/NewsfeedPlugin.py#L81
In the SQL query we have a WHEN condition which does date_added < strftime('%s', 'now') or something similar or if date_added is not a timestamp we can have an unexpected result...
@shortcutme Do you want me to work on it or you got it ?
I'm on it :)
I have added a change that will ignore these items: https://github.com/HelloZeroNet/ZeroNet/commit/b4eb09d5e9f2de69c416dce5f3171989231c9a99
Unfortunately the parsing with sqlite using stftime won't work reliably as it disables sqlite indexes on that field and results 100x slowdown for bigger databases
Most helpful comment
I'm on it :)