Solved

App Has Period?

Posted on 2015-02-19
2
56 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

839 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