getFirstDayOfWeek: function (win, fail) {
     try {
         var locale = getCrossPlatformLocale();
         moment.locale(locale);
         // Converting ISO format (Monday = 1, Sunday = 7) to what Cordova expects (Sunday = 1, Monday = 2, Saturday = 7)
         var shiftDay = moment().weekday(0).isoWeekday() + 1;
         win({ value: shiftDay % 8 + Math.floor(shiftDay / 8) });
     } catch (e) {
         fail({ code: 0, message: e.hasOwnProperty('message') ? e.message : e });
     }
 },
    dateToString: function (win, fail, args) {
        try {
            var date = new Date(args[0].date);
            var options = prepareAndGetDateOptions(args[0].options);
            moment.locale(getCrossPlatformLocale());

            win({ value: moment(date).format(options) });
        } catch (e) {
            fail(new GlobalizationError(GlobalizationError.FORMATTING_ERROR,
                e.hasOwnProperty('message') ? e.message : e));
        }
    }
    stringToDate: function (win, fail, args) {
        try {
            var options = prepareAndGetDateOptions(args[0].options);
            moment.locale(getCrossPlatformLocale());

            var date = moment(args[0].dateString, options).toDate();

            win({
                year: date.getFullYear(),
                month: date.getMonth(),
                day: date.getDate(),
                hour: date.getHours(),
                minute: date.getMinutes(),
                second: date.getSeconds(),
                millisecond: date.getMilliseconds()
            });
        } catch (e) {
            fail(new GlobalizationError(GlobalizationError.PARSING_ERROR,
                e.hasOwnProperty('message') ? e.message : e));
        }
    },