What does the parser accept?

8 posts, 0 answers
  1. Boots
    Boots avatar
    81 posts
    Member since:
    Dec 2008

    Posted 06 Jan 2011 Link to this post

    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
  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 11 Jan 2011 Link to this post

    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>>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Boots
    Boots avatar
    81 posts
    Member since:
    Dec 2008

    Posted 11 Jan 2011 Link to this post

    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
  5. haagel
    haagel avatar
    52 posts
    Member since:
    Feb 2010

    Posted 12 Jan 2011 Link to this post

    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".
  6. Boots
    Boots avatar
    81 posts
    Member since:
    Dec 2008

    Posted 12 Jan 2011 Link to this post

    Thanks David,

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

    ~Boots
  7. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 13 Jan 2011 Link to this post

    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>>
  8. haagel
    haagel avatar
    52 posts
    Member since:
    Feb 2010

    Posted 19 Jan 2011 Link to this post

    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...

  9. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 21 Jan 2011 Link to this post

    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>>
Back to Top
UI for WPF is Visual Studio 2017 Ready