id.js 2.9 KB

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