bn.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // moment.js language configuration
  2. // language : Bengali (bn)
  3. // author : Kaushik Gandhi : https://github.com/kaushikgandhi
  4. (function (factory) {
  5. if (typeof define === 'function' && define.amd) {
  6. define(['moment'], factory); // AMD
  7. } else if (typeof exports === 'object') {
  8. module.exports = factory(require('../moment')); // Node
  9. } else {
  10. factory(window.moment); // Browser global
  11. }
  12. }(function (moment) {
  13. var symbolMap = {
  14. '1': '১',
  15. '2': '২',
  16. '3': '৩',
  17. '4': '৪',
  18. '5': '৫',
  19. '6': '৬',
  20. '7': '৭',
  21. '8': '৮',
  22. '9': '৯',
  23. '0': '০'
  24. },
  25. numberMap = {
  26. '১': '1',
  27. '২': '2',
  28. '৩': '3',
  29. '৪': '4',
  30. '৫': '5',
  31. '৬': '6',
  32. '৭': '7',
  33. '৮': '8',
  34. '৯': '9',
  35. '০': '0'
  36. };
  37. return moment.lang('bn', {
  38. months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split("_"),
  39. monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split("_"),
  40. weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split("_"),
  41. weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split("_"),
  42. weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split("_"),
  43. longDateFormat : {
  44. LT : "A h:mm সময়",
  45. L : "DD/MM/YYYY",
  46. LL : "D MMMM YYYY",
  47. LLL : "D MMMM YYYY, LT",
  48. LLLL : "dddd, D MMMM YYYY, LT"
  49. },
  50. calendar : {
  51. sameDay : '[আজ] LT',
  52. nextDay : '[আগামীকাল] LT',
  53. nextWeek : 'dddd, LT',
  54. lastDay : '[গতকাল] LT',
  55. lastWeek : '[গত] dddd, LT',
  56. sameElse : 'L'
  57. },
  58. relativeTime : {
  59. future : "%s পরে",
  60. past : "%s আগে",
  61. s : "কএক সেকেন্ড",
  62. m : "এক মিনিট",
  63. mm : "%d মিনিট",
  64. h : "এক ঘন্টা",
  65. hh : "%d ঘন্টা",
  66. d : "এক দিন",
  67. dd : "%d দিন",
  68. M : "এক মাস",
  69. MM : "%d মাস",
  70. y : "এক বছর",
  71. yy : "%d বছর"
  72. },
  73. preparse: function (string) {
  74. return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
  75. return numberMap[match];
  76. });
  77. },
  78. postformat: function (string) {
  79. return string.replace(/\d/g, function (match) {
  80. return symbolMap[match];
  81. });
  82. },
  83. //Bengali is a vast language its spoken
  84. //in different forms in various parts of the world.
  85. //I have just generalized with most common one used
  86. meridiem : function (hour, minute, isLower) {
  87. if (hour < 4) {
  88. return "রাত";
  89. } else if (hour < 10) {
  90. return "শকাল";
  91. } else if (hour < 17) {
  92. return "দুপুর";
  93. } else if (hour < 20) {
  94. return "বিকেল";
  95. } else {
  96. return "রাত";
  97. }
  98. },
  99. week : {
  100. dow : 0, // Sunday is the first day of the week.
  101. doy : 6 // The week that contains Jan 1st is the first week of the year.
  102. }
  103. });
  104. }));