Javascript calendar range


I need to add a day choice control for two date prompt. One of them takes start date and the other takes end date. There must be two rules for users:

  1. Start date < End date
  2. Range of End date and start date can not be greater than 1 month.
    When users evade these rules , a message should alert: “Wrong choice !! you need to …”

How could we achieve this? (Javascript or anything method)

thx for advance…