diff --git a/daterangepicker.js b/daterangepicker.js
index 5f7d304b..efe5028f 100644
--- a/daterangepicker.js
+++ b/daterangepicker.js
@@ -71,6 +71,7 @@
this.locale = {
direction: 'ltr',
format: moment.localeData().longDateFormat('L'),
+ monthFormat: null,
separator: ' - ',
applyLabel: 'Apply',
cancelLabel: 'Cancel',
@@ -131,6 +132,9 @@
if (typeof options.locale.format === 'string')
this.locale.format = options.locale.format;
+ if (typeof options.locale.monthFormat === 'string')
+ this.locale.monthFormat = options.locale.monthFormat;
+
if (typeof options.locale.separator === 'string')
this.locale.separator = options.locale.separator;
@@ -705,6 +709,8 @@
}
var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY");
+ if(this.locale.monthFormat !== null)
+ dateHtml = calendar[1][1].format(this.monthFormat);
if (this.showDropdowns) {
var currentMonth = calendar[1][1].month();
diff --git a/demo.html b/demo.html
index 3157e8a1..d94fb312 100644
--- a/demo.html
+++ b/demo.html
@@ -305,6 +305,7 @@
Configuration
options.locale = {
direction: $('#rtl').is(':checked') ? 'rtl' : 'ltr',
format: 'MM/DD/YYYY HH:mm',
+ monthFormat: 'MMMM YYYY',
separator: ' - ',
applyLabel: 'Apply',
cancelLabel: 'Cancel',
diff --git a/example/amd/main.js b/example/amd/main.js
index 5c0f99a2..1e8a709f 100644
--- a/example/amd/main.js
+++ b/example/amd/main.js
@@ -80,6 +80,7 @@ $(document).ready(function() {
if ($('#locale').is(':checked')) {
options.locale = {
format: 'MM/DD/YYYY HH:mm',
+ monthFormat: 'MMMM YYYY',
separator: ' - ',
applyLabel: 'Apply',
cancelLabel: 'Cancel',
diff --git a/example/browserify/main.js b/example/browserify/main.js
index 30e92d49..4a727860 100644
--- a/example/browserify/main.js
+++ b/example/browserify/main.js
@@ -75,6 +75,7 @@ $(document).ready(function() {
if ($('#locale').is(':checked')) {
options.locale = {
format: 'MM/DD/YYYY HH:mm',
+ monthFormat: 'MMMM YYYY',
separator: ' - ',
applyLabel: 'Apply',
cancelLabel: 'Cancel',
diff --git a/website/website.js b/website/website.js
index e2179941..815e8232 100644
--- a/website/website.js
+++ b/website/website.js
@@ -77,6 +77,7 @@ $(document).ready(function() {
if ($('#locale').is(':checked')) {
options.locale = {
format: 'MM/DD/YYYY',
+ monthFormat: 'MMMM YYYY',
separator: ' - ',
applyLabel: 'Apply',
cancelLabel: 'Cancel',