I have a list of dates, and I want to run a script in order to hide past months with the script, for that script I just need to set a "1" on the next column and automatically hides the rows

The question is how to get "1" only in the past months from this table?

Here is a demo sheet for reference 

<https://docs.google.com/spreadsheets/d/1v1fZ_B5veeKaMRgk_JbT3Ds-KqdIo447ywAH82xEafE/edit?usp=sharing>