Adding internationalization to date selector
parent
9abd94ca1b
commit
7c39dfbb84
|
@ -118,10 +118,10 @@ CustomAttributesValuesDirective = ($templates, $storage) ->
|
||||||
template: templateFn
|
template: templateFn
|
||||||
}
|
}
|
||||||
|
|
||||||
module.directive("tgCustomAttributesValues", ["$tgTemplate", "$tgStorage", CustomAttributesValuesDirective])
|
module.directive("tgCustomAttributesValues", ["$tgTemplate", "$tgStorage", "$translate", CustomAttributesValuesDirective])
|
||||||
|
|
||||||
|
|
||||||
CustomAttributeValueDirective = ($template, $selectedText, $compile) ->
|
CustomAttributeValueDirective = ($template, $selectedText, $compile, $translate) ->
|
||||||
template = $template.get("custom-attributes/custom-attribute-value.html", true)
|
template = $template.get("custom-attributes/custom-attribute-value.html", true)
|
||||||
templateEdit = $template.get("custom-attributes/custom-attribute-value-edit.html", true)
|
templateEdit = $template.get("custom-attributes/custom-attribute-value-edit.html", true)
|
||||||
|
|
||||||
|
@ -158,8 +158,39 @@ CustomAttributeValueDirective = ($template, $selectedText, $compile) ->
|
||||||
selectedDate = date
|
selectedDate = date
|
||||||
onOpen: =>
|
onOpen: =>
|
||||||
$el.picker.setDate(selectedDate) if selectedDate?
|
$el.picker.setDate(selectedDate) if selectedDate?
|
||||||
firstDay: 1
|
i18n: {
|
||||||
format: 'DD MMM YYYY'
|
previousMonth: $translate.instant("COMMON.PICKERDATE.PREV_MONTH"),
|
||||||
|
nextMonth: $translate.instant("COMMON.PICKERDATE.NEXT_MONTH"),
|
||||||
|
months: [$translate.instant("COMMON.PICKERDATE.MONTHS.JAN"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.FEB"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.MAR"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.APR"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.MAY"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.JUN"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.JUL"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.AUG"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.SEP"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.OCT"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.NOV"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.MONTHS.DEC")],
|
||||||
|
weekdays: [$translate.instant("COMMON.PICKERDATE.WEEK_DAYS.SUN"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS.MON"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS.TUE"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS.WED"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS.THU"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS.FRI"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS.SAT")],
|
||||||
|
weekdaysShort: [$translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.SUN"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.MON"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.TUE"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.WED"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.THU"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.FRI"),
|
||||||
|
$translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.SAT")]
|
||||||
|
},
|
||||||
|
isRTL: $translate.instant("COMMON.PICKERDATE.IS_RTL") == "true",
|
||||||
|
firstDay: parseInt($translate.instant("COMMON.PICKERDATE.FIRST_DAY_OF_WEEK"), 10),
|
||||||
|
format: $translate.instant("COMMON.PICKERDATE.FORMAT")
|
||||||
)
|
)
|
||||||
|
|
||||||
isEditable = ->
|
isEditable = ->
|
||||||
|
@ -218,4 +249,4 @@ CustomAttributeValueDirective = ($template, $selectedText, $compile) ->
|
||||||
restrict: "AE"
|
restrict: "AE"
|
||||||
}
|
}
|
||||||
|
|
||||||
module.directive("tgCustomAttributeValue", ["$tgTemplate", "$selectedText", "$compile", CustomAttributeValueDirective])
|
module.directive("tgCustomAttributeValue", ["$tgTemplate", "$selectedText", "$compile", "$translate", CustomAttributeValueDirective])
|
||||||
|
|
Loading…
Reference in New Issue