Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
xamDateTimeRangeSlider - how to set format date dd/mm/yyyy with 24 hours clock
posted

Ho can i format date time value to be shown as dd/mm/yyyy with 24 hours clock ?

Tnx!

  • 18204
    Suggested Answer
    Offline posted

    Hello,

    Thank you for posting in our forums!

    You can format any DateTime using the StringFormat property in a Binding.

    For example, to display the date time as you require in the XamSliderDateTimeThumbs, you would need to re-template the ToolTip like so:

    <Style TargetType="{x:Type ig:XamSliderDateTimeThumb}">
        <Setter Property="ToolTipTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type ig:XamSliderDateTimeThumb}}, Path=Value, StringFormat='dd/MM/yyyy HH:mm'}"></TextBlock>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    If you need further assistance with this, please let me know and I will be glad to help.