screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <h3>Vue Js disable future date in datepicker</h3> <input type="date" v-model="selectedDate" :max="maxDate" /> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { selectedDate: null, maxDate: new Date().toISOString().split("T")[0], // Set the current date as the maximum selectable date }; }, }); </script> <style> #app { text-align: center; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.24); width: 600px; margin: 0 auto; padding: 20px; } /* Heading style */ h3 { margin-bottom: 20px; font-size: 24px; text-align: center; } /* Datepicker style */ input[type="date"] { border: 1px solid #ccc; padding: 10px; font-size: 16px; color: #333; } </style> </body> </html>