Framework7 is a full featured HTML5 framework suiteable for developing hybrid mobile and web applications. it comes with two themes: material theme for android and ios theme. Framework7 has dozens if not hundreds of easy and ready to use components. Among them is calender widget.

Calender can be used to display dates. We can also set events and date ranges. In this tutorial we see how to display date via calender, get date programmatically and also set dates. We get and set multiple dates on the calender. Check the video tutorial for demo.

Questions this Project answers.

  • Framework7 calender.
  • Framework get and set multiple dates on calender.
  • Getting started with framework7.
  • Framework7 tutorial.

Libraries Used

These are the third parties used in this project.

  • Here's the screenshot of the project.

Framework7 Calender

  • Project Structure

Project Structure

Tools used

Language: Javascript,HTML,CSS

Framework: Framework7

IDE: PHPStorm.

Topic: Framework7 Calender.

Source Code

Lets have a look at the source code. [wpsm_tabgroup]


  • Our index.html file.
  • We reference framework7 material css in the header.
  • We also reference our javascript scripts at the base of the body.
<!DOCTYPE html>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">


    <!-- REFERENCE CSS-->
    <link rel="stylesheet" href="assets/css/framework7.material.min.css">
    <link rel="stylesheet" href="assets/css/framework7.material.colors.min.css">
    <link rel="stylesheet" href="assets/css/my-app.css">


    <!-- VIEWS-->
    <div class="views">

      <!-- Your main view, should have "view-main" class-->
      <div class="view view-main">

        <!-- Top Navbar-->
        <div class="navbar">
          <div class="navbar-inner">

            <!-- We have home navbar without left link-->
            <div class="center sliding"></div>
            <div class="right">
              <!-- Right link contains only icon - additional "icon-only" class--><a href="#" class="link icon-only"> <i class="icon icon-bars"></i></a>

        <!-- Pages, because we need fixed-through navbar and toolbar, it has additional appropriate classes-->
        <div class="pages navbar-through toolbar-through">

          <!-- Page, data-page contains page name-->
          <div data-page="index" class="page">

            <!-- Scrollable page content-->
            <div class="page-content">
              <div class="content-block-title">Calender</div>
              <div class="content-block"><p>Framework7 Calender Get and Set Dates</p></div>
              <div class="list-block">
                    <div class="item-content">
                      <div class="item-inner">
                        <div class="item-input">
                          <input type="text" placeholder="Enter Launch Dates" readonly id="mCalenderID">

              <div class="content-block-title">Dates</div>
              <div class="content-block">
                <div class="row">
                  <div class="col-50"><a href="#" id="getDateBtn" class="button button-raised button-fill color-cyan">Get Dates</a></div>
                  <div class="col-50"><a href="#" id="setDateBtn" class="button button-raised button-fill color-teal">Set Dates</a></div>

        <!-- Bottom Toolbar-->
        <div class="toolbar">
          <div class="toolbar-inner"><a href="#" class="link">Home</a><a href="#" class="link">About Us</a></div>

    <script type="text/javascript" src="assets/js/framework7.min.js"></script>
    <script type="text/javascript" src="assets/js/main.js"></script>


  • Main class.
  • Instantiate Calender,passing in option parameters
  • Get selected dates.
  • Set array of dates
var mainClass=function()
     -Initialize your app
     -Export selectors engine
    var myApp = new Framework7();
    var $$ = Dom7;

    - Initialize app
        var myCalender = myApp.calendar({
            input: '#mCalenderID',
        $$('#getDateBtn').on('click', function () {
        $$('#setDateBtn').on('click', function () {
            var dates=[new Date('2016-10-21'),new Date('2015-9-20'),new Date('2014-8-19')]


m=new mainClass();

Video Tutorial

Below is the video version of this tutorial.


  • Download the Project below.


How to Download and Run.

  1. Download the project above.
  2. You'll get a zipped file,extract it.
  3. You'll have three files : html,css and javascript.
  4. Place them in a folder and run the index.html file.That's it.


  • Visit our channel for more examples like these.
  • Lets share tips and ideas in our Facebook Page.