cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zalun <...@git.apache.org>
Subject [GitHub] cordova-plugin-globalization pull request: CB-7102 - Initial imple...
Date Fri, 11 Jul 2014 17:46:16 GMT
Github user zalun commented on the pull request:

    https://github.com/apache/cordova-plugin-globalization/pull/17#issuecomment-48761078
  
    @rodms10 I've been checking the plugin with this code:
    
    ```
            navigator.globalization.getLocaleName(
                function(lang) {
                  console.log('getLocaleName: ' + lang);
                }, 
                function() {alert('ERROR1')});
    
            navigator.globalization.getPreferredLanguage(
                function(lang) {
                  console.log('getPreferredLanguage: ' + lang.value);
                }, 
                function() {alert('ERROR2')});
    
            navigator.globalization.dateToString(new Date('2014-10-30'), 
                function(format) {
                  console.log('long, time and date: ' + format.value);
                },
                function() {alert('ERROR3')}, {formatLength: 'long', selector: 'time and date'});
    
            navigator.globalization.dateToString(new Date('2014-10-30'), 
                function(format) {
                  console.log('long, time: ' + format.value);
                },
                function() {alert('ERROR4')}, {formatLength: 'long', selector: 'time'});
    
            navigator.globalization.dateToString(new Date('2014-10-30'), 
                function(format) {
                  console.log('date: ' + format.value);
                },
                function() {alert('ERROR5')}, {selector: 'date'});
    
            navigator.globalization.dateToString(new Date('2014-10-30'), 
                function(format) {
                  console.log('standard: ' + format.value);
                },
                function() {alert('ERROR6')});
    
            navigator.globalization.stringToDate('2011-10-10T14:48:00', 
                function(date) {
                  console.log('stringToDate', date);
                },
                function() {alert('ERROR7')}, {'selector': 'time and date'});
    
            navigator.globalization.getFirstDayOfWeek(
                function(day) {
                  console.log('first day of week', day.value);
                },
                function() {alert('ERROR8')});
    
            navigator.globalization.getDateNames(
                function(names) {
                  console.log('date names', names.value);
                },
                function() {alert('ERROR9')}, {'item': 'months', 'type': 'genitive'});
    
            navigator.globalization.isDayLightSavingsTime(new Date('2014-01-01'),
                function(isIt) {
                  console.log('is 1 Jan DST?', isIt.dst);
                },
                function() {alert('ERROR10')});
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message