Skip to content

Commit 593a382

Browse files
committed
Added support for "yyyy-MM" format
Added support for "yyyy-MM" Date format as per #121.
1 parent b6dc634 commit 593a382

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+98
-53
lines changed

DateTimePicker.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

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

10-
"version": "0.1.35",
10+
"version": "0.1.36",
1111

1212
"author": {
1313
"name": "Curious Solutions",

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"input"
1616
],
1717

18-
"version": "0.1.35",
18+
"version": "0.1.36",
1919

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

demo/Format-MonthYear.htm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
<div class="separator-1">
4141
<p>Format - "MM-yyyy"</p>
4242
<input type="text" data-field="date" data-format="MM-yyyy" readonly>
43+
44+
<p>Format - "yyyy-MM"</p>
45+
<input type="text" data-field="date" data-format="yyyy-MM" readonly>
4346
</div>
4447

4548

dist/DateTimePicker-ltie9.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------------
22
33
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
4-
Version 0.1.35
4+
Version 0.1.36
55
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
66
http://curioussolutions.github.io/DateTimePicker
77
https://github.com/CuriousSolutions/DateTimePicker

dist/DateTimePicker-ltie9.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------------
22
33
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
4-
Version 0.1.35
4+
Version 0.1.36
55
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
66
http://curioussolutions.github.io/DateTimePicker
77
https://github.com/CuriousSolutions/DateTimePicker

dist/DateTimePicker-ltie9.min.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------------
22
33
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
4-
Version 0.1.35
4+
Version 0.1.36
55
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
66
http://curioussolutions.github.io/DateTimePicker
77
https://github.com/CuriousSolutions/DateTimePicker

dist/DateTimePicker-ltie9.min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------------
22
33
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
4-
Version 0.1.35
4+
Version 0.1.36
55
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
66
http://curioussolutions.github.io/DateTimePicker
77
https://github.com/CuriousSolutions/DateTimePicker

dist/DateTimePicker.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------------
22
33
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
4-
Version 0.1.35
4+
Version 0.1.36
55
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
66
http://curioussolutions.github.io/DateTimePicker
77
https://github.com/CuriousSolutions/DateTimePicker

dist/DateTimePicker.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------------
22
33
jQuery DateTimePicker - Responsive flat design jQuery DateTime Picker plugin for Web & Mobile
4-
Version 0.1.35
4+
Version 0.1.36
55
Copyright (c)2016 Curious Solutions LLP and Neha Kadam
66
http://curioussolutions.github.io/DateTimePicker
77
https://github.com/CuriousSolutions/DateTimePicker
@@ -357,6 +357,10 @@ $.cf = {
357357
// 6 - "MMM yyyy"
358358
sDate = "MMMM" + oDTP.settings.monthYearSeparator + "yyyy";
359359
oDTP.oData.sArrInputDateFormats.push(sDate);
360+
361+
// 7 - "yyyy MM"
362+
sDate = "yyyy" + oDTP.settings.monthYearSeparator + "MM";
363+
oDTP.oData.sArrInputDateFormats.push(sDate);
360364
},
361365

362366
_setTimeFormatArray: function()
@@ -814,6 +818,10 @@ $.cf = {
814818
{
815819
sOutput = oFDT.month + oDTP.settings.monthYearSeparator + oFDT.yyyy;
816820
}
821+
else if(oDTP.oData.bArrMatchFormat[7])
822+
{
823+
sOutput = oFDT.yyyy + oDTP.settings.monthYearSeparator + oFDT.MM;
824+
}
817825
}
818826
else if(oDTP.oData.bTimeMode)
819827
{
@@ -1304,6 +1312,11 @@ $.cf = {
13041312
iNumberOfColumns = 2;
13051313
sArrFields = ["month", "year"];
13061314
}
1315+
else if(oDTP.oData.bArrMatchFormat[7]) // "yyyy-MM"
1316+
{
1317+
iNumberOfColumns = 2;
1318+
sArrFields = ["year", "month"];
1319+
}
13071320
}
13081321
else if(oDTP.oData.bTimeMode)
13091322
{
@@ -2094,6 +2107,12 @@ $.cf = {
20942107
iMonth = oDTP._getFullMonthIndex(sArrDate[0]);
20952108
iYear = parseInt(sArrDate[1]);
20962109
}
2110+
else if(oDTP.oData.bArrMatchFormat[7]) // "yyyy MM"
2111+
{
2112+
iDate = 1;
2113+
iMonth = parseInt(sArrDate[1]) - 1;
2114+
iYear = parseInt(sArrDate[0]);
2115+
}
20972116
}
20982117
else
20992118
{
@@ -2552,7 +2571,7 @@ $.cf = {
25522571

25532572
if(oDTP.oData.bDateMode)
25542573
{
2555-
if(oDTP.oData.bArrMatchFormat[4]) // "MM-yyyy"
2574+
if(oDTP.oData.bArrMatchFormat[4] || oDTP.oData.bArrMatchFormat[7]) // "MM-yyyy"
25562575
$(oDTP.element).find(".month .dtpicker-compValue").val(oFormattedDate.MM);
25572576
else if(oDTP.oData.bArrMatchFormat[6]) // "MMMM yyyy"
25582577
$(oDTP.element).find(".month .dtpicker-compValue").val(oFormattedDate.month);
@@ -2570,14 +2589,16 @@ $.cf = {
25702589
}
25712590
else
25722591
{
2573-
if(oDTP.oData.bDateMode && (oDTP.oData.bArrMatchFormat[4] || oDTP.oData.bArrMatchFormat[5] || oDTP.oData.bArrMatchFormat[6]))
2592+
if(oDTP.oData.bDateMode && (oDTP.oData.bArrMatchFormat[4] || oDTP.oData.bArrMatchFormat[5] || oDTP.oData.bArrMatchFormat[6] || oDTP.oData.bArrMatchFormat[7]))
25742593
{
25752594
if(oDTP.oData.bArrMatchFormat[4])
25762595
sDate = oFormattedDate.MM + oDTP.settings.monthYearSeparator + oFormattedDate.yyyy;
25772596
else if(oDTP.oData.bArrMatchFormat[5])
25782597
sDate = oFormattedDate.monthShort + oDTP.settings.monthYearSeparator + oFormattedDate.yyyy;
25792598
else if(oDTP.oData.bArrMatchFormat[6])
25802599
sDate = oFormattedDate.month + oDTP.settings.monthYearSeparator + oFormattedDate.yyyy;
2600+
else if(oDTP.oData.bArrMatchFormat[7])
2601+
sDate = oFormattedDate.yyyy + oDTP.settings.monthYearSeparator + oFormattedDate.MM;
25812602
}
25822603
else
25832604
sDate = oFormattedDate.dayShort + ", " + oFormattedDate.month + " " + oFormattedDate.dd + ", " + oFormattedDate.yyyy;

dist/DateTimePicker.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)