question

HenrikLie-4901 avatar image
0 Votes"
HenrikLie-4901 asked HenrikLie-4901 answered

Localize a DateTimeDropdown with B2C custom policy

Hello!
I have this ClaimType

   <ClaimType Id="dateOfBirth">
     <DisplayName>Date Of Birth</DisplayName>
     <DataType>date</DataType>
     <UserHelpText>The date on which you were born.</UserHelpText>
     <UserInputType>DateTimeDropdown</UserInputType>
   </ClaimType>

And I want to localize the different dropdowns (day, month, year) to Norwegian (dag, måned, år). The best way I can think of do this, by information provided by the documentation is this way:

       <LocalizedCollection ElementType="ClaimType" ElementId="dateOfBirth" TargetCollection="Restriction">
         <ItemText="Måned" Value="0" />
         <ItemText="Januar" Value="1" />
       </LocalizedCollection>

But this cant work, since I'm not specifying the month dropdown anywhere.

Would love som feedback on this!

Henrik Lie

azure-ad-b2c
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

HenrikLie-4901 avatar image
1 Vote"
HenrikLie-4901 answered

Found out the solutioin!

<LocalizedString ElementType="UxElement" StringId="day">Dag</LocalizedString>
<LocalizedString ElementType="UxElement" StringId="month">Måned</LocalizedString>
<LocalizedString ElementType="UxElement" StringId="year">År</LocalizedString>
<LocalizedString ElementType="UxElement" StringId="months">Januar,Februar,Mars,April,Mai,Juni,Juli,August,September,Oktober,November,Desember</LocalizedString>

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.