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 ;
0 commit comments