How can I write a window function using something like row_number to increment only on discrete values?
You want dense_rank() instead of row_number()

select my_date,
       dense_rank() over(order by my_date asc)
from my_table