Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

TypeError: date.getTimezoneOffset is not a function #5871

Description

@mebibou

Bug description:

ng-model as numeric does not work properly when using datepicker-popup. By looking at this line from the source code, I would say that the check for numeric value should be done before and not after, i.e.:

$scope.date = dateParser.fromTimezone(value, timezone);

if (angular.isNumber($scope.date)) {
  $scope.date = new Date($scope.date);
}

Should be instead:

if (angular.isNumber(value)) {
  value = new Date(value);
}

$scope.date = dateParser.fromTimezone(value, timezone);

Because dateParser.fromTimezone expects a Date and not a Number, the error TypeError: date.getTimezoneOffset is not a function is thrown.

Version of Angular, UIBS, and Bootstrap

Angular: 1.5.5
UIBS: 1.3.2
Bootstrap: 3.3.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions