修改原生gantt图样式(日期格式等去符合国内习惯)
This commit is contained in:
@@ -637,8 +637,10 @@ export default AbstractRenderer.extend(WidgetAdapterMixin, {
|
||||
case 'day':
|
||||
return focusDate.format('dddd, MMMM DD, YYYY');
|
||||
case 'week':
|
||||
const dateStart = focusDate.clone().startOf('week').format('DD MMMM YYYY');
|
||||
const dateEnd = focusDate.clone().endOf('week').format('DD MMMM YYYY');
|
||||
// const dateStart = focusDate.clone().startOf('week').format('DD MMMM YYYY');
|
||||
const dateStart = focusDate.clone().startOf('week').format('YYYY MMMM DD ');
|
||||
// const dateEnd = focusDate.clone().endOf('week').format('DD MMMM YYYY');
|
||||
const dateEnd = focusDate.clone().endOf('week').format('YYYY MMMM DD ');
|
||||
return _.str.sprintf('%s - %s', dateStart, dateEnd);
|
||||
case 'month':
|
||||
return focusDate.format('MMMM YYYY');
|
||||
|
||||
@@ -112,7 +112,7 @@ const GanttView = AbstractView.extend({
|
||||
allowedScales = Object.keys(this.SCALES);
|
||||
}
|
||||
|
||||
const scale = params.context.default_scale || arch.attrs.default_scale || 'month';
|
||||
const scale = params.context.default_scale || arch.attrs.default_scale || 'week';
|
||||
const initialDate = moment(params.context.initialDate || params.initialDate || arch.attrs.initial_date || new Date());
|
||||
const offset = arch.attrs.offset;
|
||||
if (offset && scale) {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-0 o_gantt_header_scale">
|
||||
<t t-set="formats" t-value="{'week': 'dddd, Do', 'month': 'DD', 'year': isMobile ? 'MMM' : 'MMMM'}"/>
|
||||
<t t-set="formats" t-value="{'week': 'Do(dddd)', 'month': 'DD', 'year': isMobile ? 'MMM' : 'MMMM'}"/>
|
||||
|
||||
<t t-foreach="widget.viewInfo.slots" t-as="slot">
|
||||
<t t-set="isToday" t-value="slot.isSame(new Date(), 'day') && widget.state.scale !== 'day'"/>
|
||||
|
||||
Reference in New Issue
Block a user