ace:dateTimeEntry converts invalid date to its another date - validation

I have an ace:dateTimeEntry component as below :
<ace:dateTimeEntry id="surveyDate" partialSubmit="true" renderAsPopup="true"
value="#{maintainAppointmentManagedBean.surveyNewDate}"
pattern="dd/MM/yyyy" showButtonPanel="true" navigator="true"
valueChangeListener="#{maintainAppointmentManagedBean.surveyDateChangeListener}">
</ace:dateTimeEntry>
When I manually enter an invalid date such as 21544/10/2012, icefaces converts it to some acceptable format such as 10/12/2020 or similar. It must be doing some background calculation due to which it converts the invalid date to some other date. When it reaches my own validator, the date is already converted into some other date thus my validation has no effect and no message is displayed regarding the invalid date format. There is no JIRA raised to address this. Before I raise this as a bug has anyone else faced this problem or have any solution.
Also, the problem does not occur when pattern="dd/MM/yyyy hh:mm". It occurs only when pattern is pattern="dd/MM/yyyy"
Thanks,
Dakshata Gulkhobare

I tried adding lenientParsing="false" into ace:dateTimeEntry
and it works for me.
dateTimeEntry

Related

MaskedTextBox for dates?

ERROR: .ArgumentException: The value representation '3/7/2021' does not match the mask.
I am using the MaskedTextBox (from xceed wpftoolkit). I would like the user to input and see a clean date as "__/__/____" in typical US fashion as MM/dd/yyyy.
The following works correctly for "3/7/2021",
<xceed:MaskedTextBox Width="240" FontSize="28" IncludeLiteralsInValue="True" Value="{Binding EffectiveDateFrom, UpdateSourceTrigger=LostFocus}" ValueDataType="{x:Type s:DateTime}" Mask="0/0/0000" />
but fails when the mask is changed to
Mask="00/00/0000"
So how is a mask written that will allow for both dates as "12/30/1999" or "3/7/2021" ?
Thank you for any help on this. (Note: I am not opposed to any solution: I have seen some suggestions to use the DatePicker instead. Any thoughts?)
TIA
According to their documentation what you want is: 90/90/0000
If you use #0/#0/0000 you would have to type the leading spaces!
HTH

VS Reporting Services - [rsInvalidFormatString] The Format value for the textrun is not valid

I wrote code in SQL Server that gives the year, the month and some data for those months in separate columns. The column for month (MM) gives months in numeric digits (1 to 12).
The code I used was:
Select ....
,Month(IRDate) AS MM
,...
I created a report in MS VS Report builder and included all the data in table columns. The report runs fine. However, at the bottom I get the below warning message:
[rsInvalidFormatString] The Format value for the textrun
‘MM.Paragraphs[0].TextRuns[0]’ is not valid. Format specifier was
invalid.
I checked the formatting for that cell, it is set to default - No formatting.
In the report, I've set the parameter to have a default value as
=DateValue("September 01, 2016")
Would that be the issue? Maybe the default value is not the right format? I removed the default value and kept it as no specified value. Warning message still comes up.
How can I fix this?
Have you tried formatting the textbox properties that holds the MM value to be a number datatype with no decimal places?
Regarding your other question about the default parameter value, I have typically seen DateValue formatted as such: 9/1/2016
Also, is your parameter datatype set to Date/Time?
Apparently, the error message '[rsInvalidFormatString] The Format value for the textrun....' is a log message. Rectifying the problem does not take away the message because it is a log message. So even after you correct the issue, the message will still show.
The only way to remove that message is to simply restart Visual Studio. When Visual Studio starts back up, the log is cleared and you won't see the message any more.
"Who knew healthcare would be so complicated?" ;)

How to format CRM "Date Only" field to string with Freemarker?

Im trying to build a email template with Freemarker/Clickdimensions plugin in CRM 2013. I have a "Date only" field on an entity which for example contains the date 2017-04-17. I want this date to show as the following: Monday 17 april.
This is done with Freemarker and I have tried the following:
<#assign x = Recipient.field_booking.field_scheduleddate?time>
${x?string.full}
This doesnt seem to work. Im not getting any result at all, just an empty line.
Does anyone know what could be wrong?
I will assume that field_scheduleddate is a string (not a java.util.Date).
At ?time FreeMarker should throw and exception saying something like that the string doesn't follow the expected pattern. I suspect the framework you are using catches and suppresses that exception (which makes using FreeMarker much much harder). Check the logs, maybe it's there.
You want to deal with a date-only value there, hence you should use ?date, as ?time is for time-only values. Also, field_scheduleddate apparently uses ISO 8601 format, so unless the date_format configuration setting is set to ISO, you will have to use ?date.iso (supported since FreeMarker 2.3.21).
As of printing the date, ?string.full should work, but usually you should set date_format globally to the format you prefer, and then you can simply write ${x}.
(Also note that #assign is unnecessary above, as you can put arbitrarily complex expression inside ${}.)

Kendo DateTimePicker, after parsing the Date the Year is Incorrect

Good Afternoon Fellow Code Monkey's
I'm new to StackOverflow, and Kendo UI programming. My problem is as follows. When trying to parse the date, and everything seems to work correctly until I get to the year portion.
here is my Javascript Code
$('#datepicker').kendoDatePicker({
format: 'MM dd yyyy',
parseFormats:['M/d/yy', 'MM/d/yy', 'MM/dd/yy', 'M/dd/yy', 'M/d/yyyy', 'MM/d/yyyy', 'MM/dd/yyyy','M/dd/yyyy','Mdyy','MMdyy', 'MMddyy', 'Mdyyyy', 'Mddyyyy', 'MMddyyyy', 'M-d-yy', 'MM-d-yy', 'MM-dd-yy', 'M-dd-yy', 'M-d-yyyy', 'MM-d-yyyy', 'MM-dd-yyyy', 'M-dd-yyyy']
});
Basically I want the user to be able to type the date into the Datepicker in any format, from 05052012 to 5/5/2012, etc and then the box formats. The above code for instance when entering "05052012" returns in the box 05 05 2020. Is there something wrong with how I have the year set up?
Thanks in advance,
SithApprentice
I think I have it figured out, seems sort of silly now. Apparently it has to do with the order in which I'm passing the formats with which I will be paresing. those with yy must come at the end, and those with yyyy must come at the beginning. I really wishTelerik mentioned this in their API Reference section for the date picker. From theier examples they make it seem like the order does not matter.

Validate dates before 1970-01-01

How can I validate date before 1970-01-01 (like 1900-01-01)?
When I try to use CDateVaildator it ends with CTimestamp::getTimestamp() (I found it with help of debugger)
return #mktime($hr,$min,$sec,$mon,$day,$year)
where $hr=0, $min=0, $sec=0, $mon=1, $dat=1, $year=1900 which obviously returns false and this fails whole validation.
CTimestamp::getTimestamp() will generate a timestamp for any dates from 1901 (not 1900!) up to 2038. For dates between 1901 and 1970 it generates a negative number. Just tested it, and the earliest date I can get to work is 14th December 1901. Anything before this throws an error. Not sure how to deal with dates outside this range!
In Yii there is an error described here. The solution is presented there but for some reason it's not included in Yii 1.1.14 although it's marked as committed to trunk.
To make long story short - the fix tries to build timestamp only when there is a property in rules defined.
To use it in own project you have to extend CDateValidator and CDateTimeParser.

Resources