Yes, tried a variation of checking that toISOString was a function and for some reason it wasn't getting the same result as the try catch.  Should I try that again and fix the pull request?

-----Original Message-----
From: "Lam Chau" <notifications@github.com>
Sent: ‎1/‎28/‎2014 11:18 PM
To: "angular-ui/ui-date" <ui-date@noreply.github.com>
Cc: "Allen" <anewton@tsugasoft.com>
Subject: Re: [ui-date] Handle undefined toISOString() method in uiDateFormat directive. (#67)

> @@ -110,8 +110,14 @@ angular.module('ui.date', [])
>          });
>          modelCtrl.$parsers.push(function(value){
>            if (value) {
> -            return value.toISOString();
> -          }
> +                var isoString = '';
> +                try {
> +                    isoString = value.toISOString();
> +                } catch (e) {
> +                    //let this error pass
> +                }
> +                return isoString;
> +            }

instead of using a `try`/`catch` for flow control, we could just check the property no?

```javascript
// alternatively (more defensive) 
if (value && typeof value.toISOString === "function") {
  return value.toISOString();
}
```

---
Reply to this email directly or view it on GitHub:
https://github.com/angular-ui/ui-date/pull/67/files#r9258058