id.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //! moment.js locale configuration
  2. //! locale : Bahasa Indonesia (id)
  3. //! author : Mohammad Satrio Utomo : https://github.com/tyok
  4. //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
  5. (function (global, factory) {
  6. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :
  7. typeof define === 'function' && define.amd ? define(['moment'], factory) :
  8. factory(global.moment)
  9. }(this, function (moment) { 'use strict';
  10. var id = moment.defineLocale('id', {
  11. months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
  12. monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),
  13. weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
  14. weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
  15. weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
  16. longDateFormat : {
  17. LT : 'HH.mm',
  18. LTS : 'HH.mm.ss',
  19. L : 'DD/MM/YYYY',
  20. LL : 'D MMMM YYYY',
  21. LLL : 'D MMMM YYYY [pukul] HH.mm',
  22. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  23. },
  24. meridiemParse: /pagi|siang|sore|malam/,
  25. meridiemHour : function (hour, meridiem) {
  26. if (hour === 12) {
  27. hour = 0;
  28. }
  29. if (meridiem === 'pagi') {
  30. return hour;
  31. } else if (meridiem === 'siang') {
  32. return hour >= 11 ? hour : hour + 12;
  33. } else if (meridiem === 'sore' || meridiem === 'malam') {
  34. return hour + 12;
  35. }
  36. },
  37. meridiem : function (hours, minutes, isLower) {
  38. if (hours < 11) {
  39. return 'pagi';
  40. } else if (hours < 15) {
  41. return 'siang';
  42. } else if (hours < 19) {
  43. return 'sore';
  44. } else {
  45. return 'malam';
  46. }
  47. },
  48. calendar : {
  49. sameDay : '[Hari ini pukul] LT',
  50. nextDay : '[Besok pukul] LT',
  51. nextWeek : 'dddd [pukul] LT',
  52. lastDay : '[Kemarin pukul] LT',
  53. lastWeek : 'dddd [lalu pukul] LT',
  54. sameElse : 'L'
  55. },
  56. relativeTime : {
  57. future : 'dalam %s',
  58. past : '%s yang lalu',
  59. s : 'beberapa detik',
  60. m : 'semenit',
  61. mm : '%d menit',
  62. h : 'sejam',
  63. hh : '%d jam',
  64. d : 'sehari',
  65. dd : '%d hari',
  66. M : 'sebulan',
  67. MM : '%d bulan',
  68. y : 'setahun',
  69. yy : '%d tahun'
  70. },
  71. week : {
  72. dow : 1, // Monday is the first day of the week.
  73. doy : 7 // The week that contains Jan 1st is the first week of the year.
  74. }
  75. });
  76. return id;
  77. }));