We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Query builder - date column custom format

Thread ID:

Created:

Updated:

Platform:

Replies:

150790 Jan 20,2020 09:51 AM UTC Jan 23,2020 11:29 AM UTC JavaScript - EJ 2 1
loading
Tags: Query Builder
ssvinciak
Asked On January 20, 2020 09:51 AM UTC

Hello,

I have updated to ej2@17.4.43 version. I have query builder with date and custom format "d. M. y". It worked before update, but it does not and throws error with message "Error: Format options or type given must be invalid". I can't figure out how to change format to make it work. Can you provide any information?


Saranya Dhayalan [Syncfusion]
Replied On January 23, 2020 11:29 AM UTC

Hi Stefan, 
 
Thank you for contacting Syncfusion support, 
 
We have checked your reported query. We would like to let you know that if you load your culture file, the Querybuilder is loaded based on that culture file. You don’t need to specify the format. Please find the below code snippet: 
 
Packages.json: 
 
"dependencies": { 
        "@syncfusion/ej2-querybuilder": "*", 
        "cldr-data": "^36.0.0" 
    }, 
System.config.js 
 
    map: { 
        app: 'app', 
 
        //Syncfusion packages mapping 
        "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js", 
        "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js", 
        "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js", 
        "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js", 
        "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js", 
        "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js", 
        "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js", 
        "@syncfusion/ej2-calendars": "syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js", 
        "@syncfusion/ej2-dropdowns": "syncfusion:ej2-dropdowns/dist/ej2-dropdowns.umd.min.js", 
        "@syncfusion/ej2-querybuilder": "syncfusion:ej2-querybuilder/dist/ej2-querybuilder.umd.min.js", 
        "cldr-data": "npm:cldr-data", 
        "plugin-json": "npm:systemjs-plugin-json/json.js" 
    }, 
    meta: { 
        '*.json': { loader: 'plugin-json' } 
    }, 
    packages: { 
        'app': { main: 'app', defaultExtension: 'js' }, 
        'cldr-data': { main: 'index.js', defaultExtension: 'js' } 
   
 
App.ts 
 
import { QueryBuilder, ColumnsModel, ChangeEventArgs } from '@syncfusion/ej2-querybuilder'; 
import { DatePicker } from '@syncfusion/ej2-calendars'; 
import { loadCldr, setCulture } from '@syncfusion/ej2-base'; 
declare var require: any; 
 
loadCldr( 
    require('cldr-data/main/de/ca-gregorian.json'), 
    require('cldr-data/main/de/numbers.json'), 
    require('cldr-data/main/de/timeZoneNames.json') 
); 
    let qryBldrObj: QueryBuilder = new QueryBuilder({ 
        width: '70%', 
        columns: columnData, 
        change: (args: ChangeEventArgs) => { 
            setCulture('de'); 
       
    }); 
    qryBldrObj.appendTo('#querybuilder'); 
setCulture('de'); 
 
In Querybuilder component we will dynamically render the other components. So that we set the culture in change event. 
 
For your convenience we have prepared a sample. Please find the below sample link: 
 
 
 
For you reference please find the below doc link: 
 
 
Could you please check the above sample and get back to us if you need further assistance on this? 
 
Regards, 
Saranya D 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon