Skip to content

Instantly share code, notes, and snippets.

@capocasa
Created July 4, 2014 13:47
Show Gist options
  • Save capocasa/542afaecaf67c2722963 to your computer and use it in GitHub Desktop.
Save capocasa/542afaecaf67c2722963 to your computer and use it in GitHub Desktop.
--- a/plugins/sfFormExtraPlugin/lib/widget/sfWidgetFormJQueryDate.class.php
+++ b/plugins/sfFormExtraPlugin/lib/widget/sfWidgetFormJQueryDate.class.php
@@ -90,8 +90,8 @@ class sfWidgetFormJQueryDate extends sfWidgetForm
function wfd_%s_check_linked_days()
{
- var daysInMonth = 32 - new Date(jQuery("#%s").val(), jQuery("#%s").val() - 1, 32).getDate();
- jQuery("#%s option").attr("disabled", "");
+ var daysInMonth = new Date(jQuery("#%s").val(), jQuery("#%s").val(), 0).getDate();
+ jQuery("#%s option").attr("disabled", null);
jQuery("#%s option:gt(" + (%s) +")").attr("disabled", "disabled");
if (jQuery("#%s").val() > daysInMonth)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment