Automatic date formating mm/yyyy to mm/dd/yyyy - InfoPath Dev
in

InfoPath Dev

Automatic date formating mm/yyyy to mm/dd/yyyy

Last post 05-22-2016 04:01 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-19-2016 08:13 AM

    Automatic date formating mm/yyyy to mm/dd/yyyy

    Hi, thanks for your help in advanced.

    For example when I enter 06/2016 into a datepicker field it automatically defaults to 06/01/2016 when the user leaves the field. Is there a way to code so that when a user enters 06/2016 manually it automatically defaults to 06/31/2016 instead of 06/01/2016? So in other words to the end of the month instead of the beginning? Thanks

  • 05-22-2016 04:01 PM In reply to

    Re: Automatic date formating mm/yyyy to mm/dd/yyyy

    Hello, Airbornm3 and thank you for posting!

    You can add a rule to the field with a condition to check if it is the first day of the month (substring(field, 4, 2) = "01") and if so, just set it to a value that updates it with another function, concat(substring(field, 1, 4), "31",substring(field, 6, 10)).

    One problem is that some months are not 31. So you may need to have multiple conditions based on the month, but it is not hard to add these kinds of rules and calculations.

    Best of luck! 

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.