@osovitny/anatoly 2.0.41 → 2.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/osovitny-anatoly.umd.js +14 -14
- package/bundles/osovitny-anatoly.umd.js.map +1 -1
- package/bundles/osovitny-anatoly.umd.min.js +1 -1
- package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
- package/esm2015/lib/core/localization/localization.service.js +5 -6
- package/esm2015/lib/core/localization/localize.pipe.js +13 -12
- package/fesm2015/osovitny-anatoly.js +14 -14
- package/fesm2015/osovitny-anatoly.js.map +1 -1
- package/package.json +1 -1
|
@@ -717,16 +717,15 @@
|
|
|
717
717
|
};
|
|
718
718
|
LocalizationService.prototype.getLocalizedDate = function (key) {
|
|
719
719
|
if (dateFns.isValid(new Date(key))) {
|
|
720
|
-
return dateFns.format(new Date(key), '
|
|
720
|
+
return dateFns.format(new Date(key), 'dd.MM.yyyy', this.dateFnsLocale);
|
|
721
721
|
}
|
|
722
722
|
return "Invalid Date";
|
|
723
723
|
};
|
|
724
724
|
LocalizationService.prototype.getLocalizedDateTime = function (key) {
|
|
725
|
-
//To Do Manoj: Test in IE and make TimeZone specific changes accordingly
|
|
726
725
|
var dateValue = new Date(key);
|
|
727
726
|
if (dateFns.isValid(dateValue)) {
|
|
728
727
|
var localDate = Convert.toLocalizedDateTime(dateValue);
|
|
729
|
-
return dateFns.format(localDate, '
|
|
728
|
+
return dateFns.format(localDate, 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
|
|
730
729
|
}
|
|
731
730
|
return "Invalid Date";
|
|
732
731
|
};
|
|
@@ -742,10 +741,10 @@
|
|
|
742
741
|
}
|
|
743
742
|
if (browserTimeZone) {
|
|
744
743
|
var localDateTime = dateFnsTz.utcToZonedTime(key, browserTimeZone);
|
|
745
|
-
return dateFns.format(localDateTime, '
|
|
744
|
+
return dateFns.format(localDateTime, 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
|
|
746
745
|
}
|
|
747
746
|
else {
|
|
748
|
-
return dateFns.format(new Date(key), '
|
|
747
|
+
return dateFns.format(new Date(key), 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
|
|
749
748
|
}
|
|
750
749
|
};
|
|
751
750
|
//https://date-fns.org/v1.30.1/docs/distanceInWords
|
|
@@ -833,10 +832,10 @@
|
|
|
833
832
|
return;
|
|
834
833
|
}
|
|
835
834
|
if (!type) {
|
|
836
|
-
type = '
|
|
835
|
+
type = 'tr';
|
|
837
836
|
}
|
|
838
837
|
//Translate
|
|
839
|
-
if (type === '
|
|
838
|
+
if (type === 'tr') {
|
|
840
839
|
return this.localizeService.getLocalizedValue(inputData);
|
|
841
840
|
}
|
|
842
841
|
//Date
|
|
@@ -847,19 +846,20 @@
|
|
|
847
846
|
if (type === 'dt') {
|
|
848
847
|
return this.localizeService.getLocalizedDateTime(inputData);
|
|
849
848
|
}
|
|
850
|
-
|
|
849
|
+
//UTC DateTime
|
|
850
|
+
if (type === 'u2dt') {
|
|
851
851
|
return this.localizeService.getUTCToLocalizedDateTime(inputData);
|
|
852
852
|
}
|
|
853
|
-
//
|
|
854
|
-
if (type === '
|
|
855
|
-
return this.localizeService.
|
|
853
|
+
//DistanceInWords
|
|
854
|
+
if (type === 'dis') {
|
|
855
|
+
return this.localizeService.getLocalizedDistanceInWords(inputData, param2);
|
|
856
856
|
}
|
|
857
|
+
//DistanceToNowInWords
|
|
857
858
|
if (type === 'dis2now') {
|
|
858
859
|
return this.localizeService.getLocalizedDistanceToNowInWords(inputData);
|
|
859
860
|
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
return this.localizeService.getLocalizedDistanceInWords(inputData, param2);
|
|
861
|
+
if (type === 'u2dis2now') {
|
|
862
|
+
return this.localizeService.getUTCToLocalizedDistanceToNowInWords(inputData);
|
|
863
863
|
}
|
|
864
864
|
return inputData;
|
|
865
865
|
};
|