Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

<sp-date-picker> keeps throwing 'isInvalid' error everywhere

xiaix
Tera Guru

When the <sp-date-picker> element loads, changes, anything... I keep getting this error.

I'm in Kingston, Patch 2.

Wherever I'm using this date picker, I can't capture any dates.

 

find_real_file.png

 

find_real_file.png

 

 

1 ACCEPTED SOLUTION

xiaix
Tera Guru

Figured it out.

 

find_real_file.png

 

In the <sp-date-picker>, you NEEDfield attribute, and it should (must?) be the same as your ng-model.

 

Once this is done, bam... no more errors and the date picker works fine.

 

Not sure when they added the necessity for a "field" attribute in the <sp-date-picker> directive, but alas you do!

View solution in original post

10 REPLIES 10

xiaix
Tera Guru

It looks like "field" is undefined in scope:

find_real_file.png

 

 

So, I do this:

 

find_real_file.png

 

and it's still undefined!

In the client controller, can you add this inside the main function. I referred the Request Extension widget.

 

$scope.TEST = {
displayValue: '',
value: '',
name: ''
};


Please mark this response as correct or helpful if it assisted you with your question.

xiaix
Tera Guru

Figured it out.

 

find_real_file.png

 

In the <sp-date-picker>, you NEEDfield attribute, and it should (must?) be the same as your ng-model.

 

Once this is done, bam... no more errors and the date picker works fine.

 

Not sure when they added the necessity for a "field" attribute in the <sp-date-picker> directive, but alas you do!

For some reason, this did not work for me. The above logic worked fine for me..

here is my code:

HTML:

<sp-date-picker field="TEST" ng-model="c.data.startdate" sn-change=""></sp-date-picker>

Client Script:

$scope.TEST = {
displayValue: '',
value: '',
name: ''
};