Github user rodms10 commented on a diff in the pull request:

    
https://github.com/apache/cordova-plugin-globalization/pull/17#discussion_r14903604
  
    --- Diff: src/firefoxos/GlobalizationProxy.js ---
    @@ -0,0 +1,214 @@
    +/*
    + *
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + *
    +*/
    +
    +var GlobalizationError = require('./GlobalizationError');
    +
    +
    +function addLinkToLocales() {
    +  // Adding globalization file to the HEAD section
    +  // <link rel="resource" type="application/l10n" href="locales/date.ini" 
/>
    +   var link = document.createElement("link");
    +   link.setAttribute("rel", "resource");
    +   link.setAttribute("type", "application/l10n");
    +   link.setAttribute("href", "locales/date.ini");
    +
    +   document.head.appendChild(link);
    +}
    +
    +addLinkToLocales();
    +
    +
    +function getPreferredLanguage(successCB, errorCB) {
    +    // WARNING: this isn't perfect - there is a difference between UI 
language
    +    // and preferred language, however it doesn't happen too often.
    +    navigator.mozL10n.ready(function() {
    +      successCB({value: navigator.mozL10n.language.code});
    +    });
    +}
    +
    +function getLocaleName(successCB, errorCB) {
    +    navigator.mozL10n.ready(function() {
    +      successCB(navigator.mozL10n.language.code);
    +    });
    +}
    +
    +function dateToString(successCB, errorCB, params) {
    --- End diff --
    
    I think we can support more formats assuming what is [defined 
here](http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html) is 
supported. Got the link from [a comment in l10n_date.js 
file](https://github.com/zalun/cordova-plugin-globalization/blob/ffos-initial/src/firefoxos/l10n_date.js#L34).
    
    Long time and date is looking good, I'm getting: `Wed Oct 29 2014 5:00:00 
PM`. Long time and short date are fine too. But long date gives me a short date 
and short time gives me long time.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to