This is a migrated thread and some comments may be shown as answers.

What does the parser accept?

7 Answers 72 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Boots
Top achievements
Rank 1
Boots asked on 06 Jan 2011, 09:42 PM
Hello,

Looking for a list of words/numbers/symbols the RadDatePicker control accepts out-of-the-box. We're currently using version 2010.1.603.35. Looked in the documentation and didn't see anything.

Thanks much,
~Boots

7 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 11 Jan 2011, 10:34 AM
Hi Boots,

There are no restrictions of what will the user put in the control.

Kind regards,
Kaloyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Boots
Top achievements
Rank 1
answered on 11 Jan 2011, 03:24 PM
Hi Kaloyan,

Thanks for the response. Not quite what I was looking for. What I'm looking for is list of "Character shortcuts".
Example: If I put 15 in the input box it gives us the 15th day of the current month.
Example: If I type in Dec or December it gives us December 31st of the current year.
Example: If I type in Dec 2020 it will give us December current day of month 2020.

Is there a "special character" that automatically puts in today's date?

Thanks Again,
~Boots
0
haagel
Top achievements
Rank 1
answered on 12 Jan 2011, 09:48 AM
Is there a "special character" that automatically puts in today's date?
-Just type "today". :)

But I agree with you Boots. It would be nice to have a list of all these "shortcuts".
0
Boots
Top achievements
Rank 1
answered on 12 Jan 2011, 03:14 PM
Thanks David,

 That's pretty fancy. looks like you can type in "tomorrow" and "yesterday" as well.

~Boots
0
Kaloyan
Telerik team
answered on 13 Jan 2011, 03:10 PM
Hello Boots,

Actually there is a build-in functionality like this. The supported special characters are as follows: "yesterday',"tomorrow","today". As for custom cases you have to attach an event handler to the ParseDateTimeValue. Follow the code fragment bellow:

private void radDateTimePicker_ParseDateTimeValue(object sender, ParseDateTimeEventArgs args)
        {
            if (args.TextToParse.Equals("dec", StringComparison.CurrentCultureIgnoreCase))
            {
                args.Result = new DateTime(DateTime.Now.Year, 12, 31);
            }
        }


Best wishes,
Kaloyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
haagel
Top achievements
Rank 1
answered on 19 Jan 2011, 03:18 PM
Still it would be nice to have a list of all these because you can type more than just "today", "tomorrow" and "yesterday". You can also type names of days and months. It's a shame if we're missing out on features just because we don't know about them. Maybe you (Telerik) already have such a list on the web somewhere? Otherwise it wouldn't be to hard to make such a list... :)

On another note, I find it kind of disturbing that this feature is partially localized. I'm from Sweden and the DatePicker seems to know that and thus I can type "fredag" but not "friday" to set the date to the nearest friday. However i can't set the DatePicker to the current date by typing the swedish "idag" but I have to type "today". It's quite easy to provide my own parsing of the swedish words that the default parser doesn't handle, but it seems strange that some words are localized and others are not...

0
Kaloyan
Telerik team
answered on 21 Jan 2011, 09:05 AM
Hello Boots,

Thank you for the provided feedback. This is a good idea and I will definitely log it into our system. As for the list of special names - "Today","Tomorrow", "Yesterday"

All the best,
Kaloyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
DatePicker
Asked by
Boots
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Boots
Top achievements
Rank 1
haagel
Top achievements
Rank 1
Share this question
or