Telerik Forums
Kendo UI for jQuery Forum
4 answers
501 views

Our app is fully localized/globalized, supporting (some of the few) en-US and de-DE.

In our DB, some of the currency values are stored in USD, some of the currency values are stored as Euros. Obviously, we want to keep the currency straight between the two - formatting as USD, when in fact it is Euros, would be a big mistake.

So, following this example, we can format for USD/Euros, given the proper locale.

My issue is: Given data (12345.67) in the DB in Euros and the user logged into the en-US locale, I want to have the Euro symbol show up properly (including location of symbol relative to numeric value) and the commas/decimals to be proper as well (i.e. 12,345.67 €). And the reverse, given data (98765.43) in the DB in USD and the user logged into de-DE, I want to have the USD symbol show up and the commas/decimals to be proper as well (i.e. $ 98.765,43).

How can I achieve this?

Thanks,

--Ed

 

Daniel
Telerik team
 answered on 05 May 2015
3 answers
653 views
I could not find any documentation on the use of kendo.timezones:
  • http://docs.telerik.com/kendo-ui/framework/globalization/overview
  • http://docs.telerik.com/kendo-ui/framework/localization/overview

 

It seems to me that kendo has all the bricks to handle timezones without requiring momentJS or any other comparable library, but I cannot relally figure out how to use it.

Ideally, I want to store all dates server side in UTC format and display them in the user's timezone.

Question 1: Can Kendo UI detect user's timezone or should we let users define their timezone in the application profile?

Question 2: how do you convert from UTC to local timezone and from local timezone to UTC using the kendo framework?

Question 3: In a kendo.data.Model or kendo.observable, where do you recommend making conversions?

Question 4: In a kendo.data.DataSource, where do you recommend making conversions?
Georgi Krustev
Telerik team
 answered on 25 Feb 2015
2 answers
225 views
We try to use Kendo UI localization, but it gives us different result.
If we show the date in the grid, it give us a full GMT formattet datetime display. And if we are using the datetimepicker, it is actually using the mashines localization.

Are we doing something wrong, or is it a bug in Kendo, so we need to hardcode the datetime format ?

(Se pictures)

Kind Regards


Peter Beyer
CRM-Byggefakta
Peter Beyer
Top achievements
Rank 1
 answered on 18 Dec 2014
1 answer
59 views
Date format
in grid and input fields:

-         
Works
for input - data-role: datepicker, data-role: datetimepicker and in date picker
in the grid filter menu, but doesn’t show date format according to current
culture in the grid and input - data-type: date

 

 
Georgi Krustev
Telerik team
 answered on 18 Dec 2014
2 answers
225 views
1. I configured filters for grid but after changing language there are not translated. How to use messages from kendo.messages.xx-XX.min.js files in such setup:
filterable :{
            extra: false,
            operators: {
                string: {
                    contains: 'Contains',
                    eq: 'Is equal',
                    neq: 'Is not equal'
                },
                date: {
                    lte: 'To',
                    gte: 'From'
                },
                number: {
                    eq: 'Is equal',
                    neq: 'Is not equal',
                    gt: 'Greater then',
                    gte: 'Greater then or equal',
                    lt: 'Less then',
                    lte: 'Less then or equal'
                }
            }
        },

2. I use $translateProvider in AngularJS for translations and tried to setup in config also kendo.culture("en-GB"); but it doesn't work. How to setup translations for AngularJS with ability to change dynamically to be consistent with $translate service if needed 

Alexander Valchev
Telerik team
 answered on 17 Sep 2014
2 answers
166 views
Hi, how can I translate the DatePicker to my language ? I've post new question in Stackoverflow 

http://stackoverflow.com/questions/25300046/translate-date-picker-kendo-ui-with-angularjs

any help?
Rodrigo
Top achievements
Rank 1
 answered on 15 Aug 2014
2 answers
48 views
Hi all,

I have a Backbone application with multiple KendoUi [v2013.2.918; kendo.all.min.js] components e.g. Grid, NumericTextBox. To display this value "12,5 h" in a numericTextBox, I use this:

this.$('.kendoHourInput').kendoNumericTextBox({
  format: '#.0 h'
});

For the development Version, not optimized with r.js (requie.js), everything works as expected. For the production Version, after the r.js optimizer, this format breaks the app:

Uncaught TypeError: Cannot read property 'numberFormat' of null

The predefined formats like "c2" or "p" works without a problem. Could it be a problem with the kendo.culture('de-DE') I use? I had similar problems with the library globalize.js, which overrides the kendo.culture. Is there a known dependency to another library who could break the optimized-code? There is a 2nd library with dependencies to globalize.js:

require.js-config
shim: {
    ...
    someLib: {
        deps: ['globalize']
    }
}

There is a forum entry on the kendo site, with a similar problem. The solution should be to load the kendo library before the globalize library. If I take a look to the script-tags on the index.html, kendo comes before globalize. So, this is not a solution that works for me.

For more information, please let me know.

Thanks 

Sascha
Sascha
Top achievements
Rank 1
 answered on 11 Jul 2014
9 answers
2.8K+ views
Hello,

The kendo date format do not seem to take the time zone into account when parsing or formatting UTC dates.
This simple test reproduces it:
$("#grid").kendoGrid({
    dataSource:{
        data:[
            {
                utcdate: kendo.parseDate("2012-04-18 11:23:45Z", "u"),
                localdate: new Date()
            }
        ],
        schema:{
            model:{
                fields:{
                    utcdate:{
                        type:"date"
                    },
                    localdate:{
                        type:"date"
                    }
                }
            }
        }
    },
    height:360,
    groupable:true,
    scrollable:true,
    sortable:true,
    pageable:true,
    columns:[
        {
            field:"utcdate",
            title:"local from UTC",
            format:"{0:yyyy-MM-dd HH:mm:ss}",
            width: 150
        },
        {
            field:"utcdate",
            title:"UTC from UTC",
            format:"{0:u}",
            width: 150
        },
        {
            field:"utcdate",
            title:"UTC-S from UTC",
            format:"{0:s}",
            width: 150
        },
        {
            field:"localdate",
            title:"local from local",
            format:"{0:yyyy-MM-dd HH:mm:ss}",
            width: 150
        },
        {
            field:"localdate",
            title:"UTC from local",
            format:"{0:u}",
            width: 150
        },
        {
            field:"localdate",
            title:"UTC-S from local",
            format:"{0:s}",
            width: 150
        }
    ]
});

  1. Parsing the 0-based UTC date apparently ignores the timezone and creates a different local date that is offset by the timezone the user is in. The "local from UTC" column should display the local time, not the 0-based UTC time.
  2. Formatting a local JavaScript date to a UTC date produces a date without taking into account the timezone. All "from local" columns are displaying the same hours, while they should be offset.

Looking at the Kendo UI source code for parsing dates, it clearly does not have a check for the "Z" timezone marker. And is also missing a UTC() function call to create the date. The formatting functions also don't use the JavaScript Date UTC functions.

Can this be fixed globally somehow?

Best Regards,
Wannes.

Georgi Krustev
Telerik team
 answered on 30 May 2014
3 answers
983 views
Hi,

I'd like to take advantage of the automatic currency formatting (using the "c" option), but by setting a specific currency symbol. However, I do not want to change the locale (which seems to be the recommended solution), because what I want is not changing the way number is formatted, BUT only the currency symbol.

Is that possible? I've tried several things but with no success.

Thanks!
Georgi Krustev
Telerik team
 answered on 29 Apr 2014
3 answers
939 views
Hi,

I need help on number formats in e.g. Kendo grid.
My number is 123456,78 and I need a format like 123.456,780.
In different threads I read formats like "{0:c}", "{0:0.000}", etc..
But I don't understand the formatting.
What means the 0 before the colon, and what possibilities I have to format the numbers?

Thanks for any help!
Masaab
Top achievements
Rank 1
 answered on 24 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?