Solved

App Has Period?

Posted on 2015-02-19
2
54 Views
Last Modified: 2015-02-21
I have never seen anything like this. When I add a child record to my main form, the Birthdate field loads with a period in the input box. I have no idea how this is happening. Has anyone in this community seen anything like this? What could be causing it? I promise this is NOT a spoof or joke.

HTML
<input name="Birthdate" class="form-control input-sm" data-bind="attr:{'id': 'Birthdate_' + $index()}, value: Birthdate, date: Birthdate, format: 'MM DD YYYY', event: {change: flagIndividualsAsEdited}" placeholder="Birthdate"/>
                        </td>

Open in new window


JS function adding child viewModel and defaults.
        self.addFamilyMember = function() {
            var individuals = new IndividualsViewModel({ Id: -1, FirstName: "", MiddleName: "", LastName: "", Gender: "", PhoneNumber: "0000000000", Email: "", Birthdate: "", AdultBirthdateDecline: 0, Ethnicity: "", USTANumber: "", FamilyRole: "", RelationshipType: "", ObjectState: ObjectState.Added });
            self.Individuals.push(individuals);
        },

Open in new window


THE DEMON PERIOD!
Input form with random period in Birthdate field.
0
Comment
Question by:wdarnellg
2 Comments
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 40622003
That's not a period...that's a hyphen.  It looks like you are using a library to enforce a particular formatting on the value of that input box (date formatting, probably).  The hyphen could be an artifact of the library trying to format a NULL value into a date.  Or perhaps the library properly detects the NULL value, and purposefully inserts the hyphen to signify it.

In any case, you'll need to look through the library manipulating that input.
0
 

Author Comment

by:wdarnellg
ID: 40622993
That was it. It was this part code that formats the date:
       var value = valueAccessor();
            var pattern = allBindings.format || "MM/DD/YYYY";
            var valueUnwrapped = ko.utils.unwrapObservable(value);

            var output = "-";
            if (valueUnwrapped !== null && valueUnwrapped !== undefined && valueUnwrapped.length > 0) {
                output = moment(valueUnwrapped).format(pattern);
            }
            if ($(element).is("input") === true) {

                $(element).val(output);
            } else {
                $(element).text(output);
            }

Open in new window


Thanks for the insight!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Don't understand jquery promises 6 37
popup load of page and setting up of session 8 26
Centered Image 2 22
Sorting a string 1 13
This article discusses four methods for overlaying images in a container on a web page
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now