DataForm: Language of DatePicker/TimePicker

Thread is closed for posting
3 posts, 1 answers
  1. Marc
    Marc avatar
    101 posts
    Member since:
    Oct 2013

    Posted 03 Nov 2017 Link to this post


    is it possible (or will it be possible in the future) to change the language of the DatePicker/TimePicker component of the DataForm?

    This includes:

    - language of the months and the shortcuts of the days in the weekwithin DatePicker

    - the date formats of DatePicker

    - the cancel and confirm button text


    Best regards

  2. Answer
    Nikolay Tsonev
    Nikolay Tsonev avatar
    340 posts

    Posted 07 Nov 2017 Link to this post

    Hello Marc,

    Thank you for your interest in UI for NativeScript.

    The DataForm component uses the default language, which is set up on the device. Regarding that, the language of the months and the shortcuts should also be changed depending on the device language and localization settings. 
    Something more, on iOS you should also set up the CFBundleLocalizations key in your Info.plist. This key describes the languages, which could be used from the application. For example:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
    <plist version="1.0">

    About the date format, at this point, changing this setting is not supported. This functionality is logged here as a new feature request. In the meantime, you could set up the format to the picker, while using the following approach. 
    <Page navigatedTo="navigated" loaded="onPageLoaded" xmlns:df="nativescript-pro-ui/dataform" xmlns="">
        <GridLayout rows="100 *" columns="">
            <Label text="Test" textWrap="true" />
        <df:RadDataForm row="1"  id="myDataForm" source="{{ ticketOrder }}" propertyCommitted="dfPropertyCommitted">
                <df:EntityProperty name="movie" displayName="Movie Name" index="0" converter="{{ $value }}" valuesProvider="{{ movieNames }}">
                        <df:PropertyEditor type="Picker" />
                <df:EntityProperty name="date" index="1" >
                        <df:PropertyEditor type="DatePicker" />

    import viewModel = require("./../view-models/ticket-order-model");
    import {RadDataForm, EntityProperty} from "nativescript-pro-ui/dataform";
    import {isIOS, isAndroid} from "platform";
    import {Page} from "ui/page";
    declare var NSDateFormatter:any;
    declare var java:any;
    export function onPageLoaded(args) {
        var page = args.object;
        page.bindingContext = new viewModel.TicketViewModel();
    export function dfPropertyCommitted(args) {
        var text = "LastEvent: " + args.propertyName + " property committed";
    export function navigated(args){
        var page:Page = <Page>args.object;
        let component:RadDataForm = <RadDataForm>page.getViewById("myDataForm");
        let entity:EntityProperty = component.getPropertyByName("date");
            var dateFormatter = NSDateFormatter.alloc().init();
            dateFormatter.dateFormat = "MM-yyyy-dd";
            entity.editor.ios.dateFormatter = dateFormatter;
            var simpleDateFormat = new java.text.SimpleDateFormat("dd-MM-yyyy", java.util.Locale.US);

    About the last point, the button text, could not be changed at this time, regarding that I would suggest logging new feature request here in the feedback repository, where you could also describe your use case.

    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  3. Marc
    Marc avatar
    101 posts
    Member since:
    Oct 2013

    Posted 07 Nov 2017 in reply to Nikolay Tsonev Link to this post

    Hello Nikolay,

    thanks for your response. Indeed, I tested this only on Android emulator, where english is set as default language and localization.

    It's the same with the text of cancel-button and ok-button.

    Regarding the date-format, I will watch the already existing issue on Github, so thanks for sharing the link.


    Best regards,


Back to Top