the easiest way is to use a datepicker plugin that offers those limits as settings.
otherwise, create the date objects yourself and compare them.
date in the format yyyymm, i want to validate the date by checking that it is not beyond today's date
I assume that to be a little bit tricky if there is no day part in the date.