Share via


AllowRelativeDates Property for French (Canada)

  Microsoft Speech Technologies Homepage

Gets or sets whether relative dates are accepted. Read/write.

Usage

ASP.NET markup: <speech:Date AllowRelativeDates="..." />
Get value: Boolean = Date.AllowRelativeDates;
Set value: Date.AllowRelativeDates = Boolean;
Data type: System.Boolean
Required: No; Default: True

Remarks

If AllowRelativeDates is set to True, relative dates like "today" and "next Tuesday" are allowed.

Example

<form ID="Form1" method="post" runat="server">
  ...
  <asp:panel ID="AppPanel" runat="server" >
      <speech:SemanticMap ID="TheSemanticMap" runat="server">
        <speech:SemanticItem ID="siDay"   runat="server"></speech:semanticitem>
        <speech:SemanticItem ID="siMonth" runat="server"></speech:semanticitem>
        <speech:SemanticItem ID="siYear"  runat="server"></speech:semanticitem>
      </speech:SemanticMap>

      <speech:CompareValidator ID="LowerDateCompareValidator" runat="server" type="Integer" 
        SemanticItemToValidate="siYear" Operator="GreaterThanEqual" ValueToCompare="1902" >
        <Prompt OnClientError="" ID="SayInvalidYear"
          PromptSelectFunction="SayInvalidYearPromptFunction" >
        </Prompt>
      </speech:CompareValidator>

      <speech:CustomValidator ID="CustomValidator1" SemanticItemToValidate="siYear" 
        ClientValidationFunction="checkDate" runat="server">
        <Prompt PromptSelectFunction="SayInvalidDatePromptFunction"></Prompt>
      </speech:CustomValidator>

      <speech:date 
        ID="PastDate"  
        DateContext="Past" 
        DaySemanticItem="siDay" 
        MonthSemanticItem="siMonth"
        YearSemanticItem="siYear" 
        RejectThreshold="0.25" 
        MaxTimeout="30000" 
        InitialTimeout="3000"
        FirstInitialTimeout="1000" 
        AutoPostBack="True" 
        BabbleTimeout="10000" 
        QuestionPrompt="quel est votre date de naissance?"
        AllowRelativeDates="True" 
        AllowHolidays="True" 
        PromptSelectFunction="datePromptSelectFunction"
        runat="server">
      </speech:date>

      <speech:Command ID="GlobalCommandHelp" runat="server" Type="Help" 
        Scope="AppPanel" XPathTrigger="/SML/Command/Help">
        <Grammar Src="Grammars\GlobalCommandHelp.grxml"></Grammar>
      </speech:Command>

  </asp:panel>
  ...
</form>

See Also

Date Class | Date Constructor | Date Members | Date Properties | Date Methods | Date Events | Date Remarks