 				groups = $.grep(groups, (n) -> n) # Filter empty groups
 				groups.join(' ')
 
+		formatExpiry = (expiry) ->
+			parts = expiry.match(/^\D*(\d{1,2})(\D+)?(\d{1,4})?/)
+			return '' unless parts
+
+			mon = parts[1] || ''
+			sep = parts[2] || ''
+			year = parts[3] || ''
+
+			if year.length > 0
+				sep = ' / '
+
+			else if sep is ' /'
+				mon = mon.substring(0, 1)
+				sep = ''
+
+			else if mon.length == 2 or sep.length > 0
+				sep = ' / '
+
+			else if mon.length == 1 and mon not in ['0', '1']
+				mon = "0#{mon}"
+				sep = ' / '
+
+			return mon + sep + year
+
 		parseExpiry = (value = "") ->
 			[month, year] = value.split(/[\s\/]+/, 2)
 

			setTimeout ->
				value   = $target.val()
				value   = replaceFullWidthChars(value)
				value   = $.payment.formatExpiry(value)

		formatExpiry = (e) ->
			# Only format if input is a number

		restrict: "A"
		require: "ngModel"
		link: (scope, el, attrs, ngModel) ->
			el.on "keypress", 	ccFormat.restrictNumeric
			el.on "keypress", 	ccFormat.restrictExpiry
			el.on "keypress", 	ccFormat.formatExpiry
			el.on "keypress", 	ccFormat.formatForwardSlash
			el.on "keypress", 	ccFormat.formatForwardExpiry
			el.on "keydown", 	ccFormat.formatBackExpiry
			el.on "change", 	ccFormat.reFormatExpiry
			el.on "input", 		ccFormat.reFormatExpiry
			el.on "paste", 		ccFormat.reFormatExpiry

			ngModel.$parsers.push ccFormat.parseExpiry
			ngModel.$formatters.push ccFormat.parseExpiry
