Have you considered using milliseconds to figure out the elapsed time instead (in milliseconds) and the converting that value to weeks? It will simplify your calculation a lot.
Algorithm can be something like:
Elapsedtime=newtimeinmilli - oldposttimestampinmilli
Weeks= elapsedtime / 1000 / 60/ 60/ 24/ 7;
Then round and ceil the value to make it a whole number.
here’s a repl.it javascript that shows I calculate the weeks passed using milliseconds
In this case I picked a test of using august 1, 2018 to compare against today’s date