Skip to content

Commit

Permalink
Added support for "yyyy-MM" format
Browse files Browse the repository at this point in the history
Added support for "yyyy-MM" Date format as per #121.
  • Loading branch information
nehakadam committed Oct 13, 2016
1 parent b6dc634 commit 593a382
Show file tree
Hide file tree
Showing 48 changed files with 98 additions and 53 deletions.
2 changes: 1 addition & 1 deletion DateTimePicker.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

"keywords": ["date", "time", "datetime", "plugin", "picker", "DatePicker", "TimePicker", "DateTimePicker", "Responsive", "Flat", "Mobile", "jquery"],

"version": "0.1.35",
"version": "0.1.36",

"author": {
"name": "Curious Solutions",
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"input"
],

"version": "0.1.35",
"version": "0.1.36",

"homepage": "http://curioussolutions.github.io/DateTimePicker/",

Expand Down
3 changes: 3 additions & 0 deletions demo/Format-MonthYear.htm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
<div class="separator-1">
<p>Format - "MM-yyyy"</p>
<input type="text" data-field="date" data-format="MM-yyyy" readonly>

<p>Format - "yyyy-MM"</p>
<input type="text" data-field="date" data-format="yyyy-MM" readonly>
</div>


Expand Down
2 changes: 1 addition & 1 deletion dist/DateTimePicker-ltie9.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/DateTimePicker-ltie9.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/DateTimePicker-ltie9.min.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/DateTimePicker-ltie9.min.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/DateTimePicker.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
27 changes: 24 additions & 3 deletions dist/DateTimePicker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down Expand Up @@ -357,6 +357,10 @@ $.cf = {
// 6 - "MMM yyyy"
sDate = "MMMM" + oDTP.settings.monthYearSeparator + "yyyy";
oDTP.oData.sArrInputDateFormats.push(sDate);

// 7 - "yyyy MM"
sDate = "yyyy" + oDTP.settings.monthYearSeparator + "MM";
oDTP.oData.sArrInputDateFormats.push(sDate);
},

_setTimeFormatArray: function()
Expand Down Expand Up @@ -814,6 +818,10 @@ $.cf = {
{
sOutput = oFDT.month + oDTP.settings.monthYearSeparator + oFDT.yyyy;
}
else if(oDTP.oData.bArrMatchFormat[7])
{
sOutput = oFDT.yyyy + oDTP.settings.monthYearSeparator + oFDT.MM;
}
}
else if(oDTP.oData.bTimeMode)
{
Expand Down Expand Up @@ -1304,6 +1312,11 @@ $.cf = {
iNumberOfColumns = 2;
sArrFields = ["month", "year"];
}
else if(oDTP.oData.bArrMatchFormat[7]) // "yyyy-MM"
{
iNumberOfColumns = 2;
sArrFields = ["year", "month"];
}
}
else if(oDTP.oData.bTimeMode)
{
Expand Down Expand Up @@ -2094,6 +2107,12 @@ $.cf = {
iMonth = oDTP._getFullMonthIndex(sArrDate[0]);
iYear = parseInt(sArrDate[1]);
}
else if(oDTP.oData.bArrMatchFormat[7]) // "yyyy MM"
{
iDate = 1;
iMonth = parseInt(sArrDate[1]) - 1;
iYear = parseInt(sArrDate[0]);
}
}
else
{
Expand Down Expand Up @@ -2552,7 +2571,7 @@ $.cf = {

if(oDTP.oData.bDateMode)
{
if(oDTP.oData.bArrMatchFormat[4]) // "MM-yyyy"
if(oDTP.oData.bArrMatchFormat[4] || oDTP.oData.bArrMatchFormat[7]) // "MM-yyyy"
$(oDTP.element).find(".month .dtpicker-compValue").val(oFormattedDate.MM);
else if(oDTP.oData.bArrMatchFormat[6]) // "MMMM yyyy"
$(oDTP.element).find(".month .dtpicker-compValue").val(oFormattedDate.month);
Expand All @@ -2570,14 +2589,16 @@ $.cf = {
}
else
{
if(oDTP.oData.bDateMode && (oDTP.oData.bArrMatchFormat[4] || oDTP.oData.bArrMatchFormat[5] || oDTP.oData.bArrMatchFormat[6]))
if(oDTP.oData.bDateMode && (oDTP.oData.bArrMatchFormat[4] || oDTP.oData.bArrMatchFormat[5] || oDTP.oData.bArrMatchFormat[6] || oDTP.oData.bArrMatchFormat[7]))
{
if(oDTP.oData.bArrMatchFormat[4])
sDate = oFormattedDate.MM + oDTP.settings.monthYearSeparator + oFormattedDate.yyyy;
else if(oDTP.oData.bArrMatchFormat[5])
sDate = oFormattedDate.monthShort + oDTP.settings.monthYearSeparator + oFormattedDate.yyyy;
else if(oDTP.oData.bArrMatchFormat[6])
sDate = oFormattedDate.month + oDTP.settings.monthYearSeparator + oFormattedDate.yyyy;
else if(oDTP.oData.bArrMatchFormat[7])
sDate = oFormattedDate.yyyy + oDTP.settings.monthYearSeparator + oFormattedDate.MM;
}
else
sDate = oFormattedDate.dayShort + ", " + oFormattedDate.month + " " + oFormattedDate.dd + ", " + oFormattedDate.yyyy;
Expand Down
2 changes: 1 addition & 1 deletion dist/DateTimePicker.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/DateTimePicker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/DateTimePicker_iOS_fix.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP, Neha Kadam, and Yanike Mann
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-cs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-de.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-en.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-es.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-fr.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-it.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-ja.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-nb.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-nl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-ro.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-ru.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-uk.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n-zh-TW.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DateTimePicker-i18n.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/DatetimePicker-i18n-zh-CN.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"input"
],

"version": "0.1.35",
"version": "0.1.36",

"homepage": "http://curioussolutions.github.io/DateTimePicker/",

Expand Down
2 changes: 1 addition & 1 deletion src/DateTimePicker-ltie9.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion src/DateTimePicker-ltie9.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
2 changes: 1 addition & 1 deletion src/DateTimePicker.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
Version 0.1.35
Version 0.1.36
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
http://curioussolutions.github.io/DateTimePicker
https://github.com/CuriousSolutions/DateTimePicker
Expand Down
Loading

0 comments on commit 593a382

Please sign in to comment.