Giter Club home page Giter Club logo

Comments (17)

hexadecy avatar hexadecy commented on August 11, 2024 1

Can you paste part of your template for this directive.
It should normally convert with the format you specified with moment.
Which version of moment have you included?
currentDate = ngModel
scope.currentDate = moment(scope.currentDate, scope.format);

from angular-material-datetimepicker.

hexadecy avatar hexadecy commented on August 11, 2024

It must be a JavaScript ISO 8601 Date-Time:
"2017-09-20T15:00:00Z" or "2017-09-20T11:00:00-04:00"
You service returns a RFC3339 with a fractional second, but you can do:
var d = new Date("2017-09-12T18:30:00.000Z");

from angular-material-datetimepicker.

bhargavmullakuru avatar bhargavmullakuru commented on August 11, 2024

thank you for your reply @hexadecy ... after getting the response can you tell me how i need to change the date/time...like you want me to do like new date(Response_Date_variable) for all the dates

from angular-material-datetimepicker.

hexadecy avatar hexadecy commented on August 11, 2024

Please check your depedencies, I cannot reproduce it.

from angular-material-datetimepicker.

bhargavmullakuru avatar bhargavmullakuru commented on August 11, 2024

@hexadecy ...actually i am directly assigning the response to the $scope model...i am not formatting the date...you want me to format with moment and assign...?

from angular-material-datetimepicker.

hexadecy avatar hexadecy commented on August 11, 2024

What error you have in F12 dev console?
$scope.myDateTime = "2017-09-12T18:30:00.000Z" is a valid date.
Because RFC3339 is a sub-profile of ISO 8601, so my first guest was wrong.
The date is always formatted by moment in this project, you don't have to format it before.

But make sure you have the right version:

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.6/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular-aria.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.5/angular-material.min.css" rel="stylesheet" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.5/angular-material.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment-with-locales.min.js"></script>

from angular-material-datetimepicker.

bhargavmullakuru avatar bhargavmullakuru commented on August 11, 2024

i am getting "2017-09-12T18:30:00.000Z" this format from my service response ...i will check for the right versions and will get back to you ..thank you for your reply @hexadecy

from angular-material-datetimepicker.

hexadecy avatar hexadecy commented on August 11, 2024

Pretty similar to one issue you have in the past: logbon72#109
AngularJS, angular-animate, angular-aria must be on the same version.
I'm only testing recent version, if you can't be on the latest version let me know.

from angular-material-datetimepicker.

hexadecy avatar hexadecy commented on August 11, 2024

@bhargavmullakuru resolved?

from angular-material-datetimepicker.

bhargavmullakuru avatar bhargavmullakuru commented on August 11, 2024

Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: itemMonth in picker.monthsAvailable(), Duplicate key: string:Invalid date, Duplicate value: Invalid date

@hexadecy This error i am getting in my Dev console..i have used the same versions that you commented above

from angular-material-datetimepicker.

bhargavmullakuru avatar bhargavmullakuru commented on August 11, 2024

@hexadecy i am using moment version 2.10.3

from angular-material-datetimepicker.

hexadecy avatar hexadecy commented on August 11, 2024

Month picker is new since beenote/angular-material-datetimepicker v1.8.4 and you need at least Angular Material 1.1.2 because of new $mdMenu.

from angular-material-datetimepicker.

hexadecy avatar hexadecy commented on August 11, 2024

I still cannot reproduce it... try this, I will make a version if you confirm me it's ok.
https://github.com/beenote/angular-material-datetimepicker/blob/gh-pages/js/angular-material-datetimepicker.js#L37
change to:
<md-menu-item ng-repeat="itemMonth in picker.monthsAvailable() track by $index">

from angular-material-datetimepicker.

bhargavmullakuru avatar bhargavmullakuru commented on August 11, 2024

@hexadecy ..thanks for your patience with my issue ... i am using angular-aria v1.4.8 and AngularJS v1.3.13... and i included latest cdn of DateTimePicker v1.9.3 .....
i am getting error of " angular.js:11607 Error: [$injector:unpr] Unknown provider: $$mdSvgRegistryProvider <- $$mdSvgRegistry <- mdcDatetimePickerDirective "

from angular-material-datetimepicker.

hexadecy avatar hexadecy commented on August 11, 2024

$$mdSvgRegistry is not included with angular-material v1.1.0-rc1
I included the calendar icon with a svg in base64 in DateTimePicker v1.9.4

I still think that you issue is in the parsing with moment, have you tried with moment 2.18.1 and with moment-with-locales.
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment-with-locales.min.js"></script>

Also are you using min-date and max-date properties?
And are you using $http to query your data service in json format?

from angular-material-datetimepicker.

bhargavmullakuru avatar bhargavmullakuru commented on August 11, 2024

@hexadecy ... I have converted this date "2017-09-12T18:30:00.000Z"to new Date("2017-09-12T18:30:00.000Z") ...in the response...it is working fine now.. i think the issue was parsing the time stamp to ISO string

from angular-material-datetimepicker.

bhargavmullakuru avatar bhargavmullakuru commented on August 11, 2024

🎉 @hexadecy thank-you for taking time and helping me on this Issue 👍

from angular-material-datetimepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.