Overview
javascript

MFCalendarPopup

This class is here for a simple stand alone function (no additional classes required) that will present a simple calendar popup and allow the user to select a date from it.


Implementation is simple:

html
<script src='https://methodfish.com/Download/MFCalendarPopup/files/latest/js/mf-calendar-popup.js'></script>
<link rel='stylesheet preload prefetch' as='style' href='https://methodfish.com/Download/MFCalendarPopup/files/latest/css/mf-calendar-popup.css'>

js
// usage: new MFCalendarPopup().getDate(caller-elem, default-date, callback-function)
var _popup = new MFCalendarPopup();
_popup.getDate(e.target, new Date(), setDate);


function closePopup() {
   _popup.removePopup();
}

function setDate(dt) {
   alert('Date set to '+dt);
}

(e.target is the triggering button - or the date input field - and allows the popup to know where to position itself)

To close the popup using javascript, either use _popup.removePopup(), or remove the .mf-calendar-popup element directly.


link Click to view a demo

square

About

License

Latest Release

Version 1.022024-07-04