如何实施波斯Calandar [英] How to implement Persian Calandar

查看:206
本文介绍了如何实施波斯Calandar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JavaFx上是否有任何波斯日历 DatePicker 的实现?



没有波斯语 choronology 在DatePicker上使用来实现波斯语calander

解决方案

我现在已经开发了一个使用日历选择器,也提供波斯日历。它最初的灵感来自Christian Schudt的精彩作品,但完全改写和增强。只需下载我的库


Is there any implementation of Persian calendar DatePicker on JavaFx ?

There is no Persian choronology to use on DatePicker to achieve a Persian calander

解决方案

I have now developed a ready-to-use calendar picker which also offers a persian calendar. It was originally inspired by the nice work of Christian Schudt, but completely rewritten and enhanced. Just download my library Time4J-v4.20 (or later, available in Maven) and use this code demo:

CalendarPicker<PersianCalendar> picker = picker.persianWithSystemDefaults();

picker.setLengthOfAnimations(Duration.seconds(0.7));
picker.setShowInfoLabel(true);
picker.setLocale(new Locale("fa", "IR"));
picker.setShowWeeks(true);

picker.setCellCustomizer(
  (cell, column, row, model, date) -> {
    if (CellCustomizer.isWeekend(column, model)) {
      cell.setStyle("-fx-background-color: #FFE0E0;");
      cell.setDisable(true);
    }
  }
);

You can also set other properties like minimum and maximum date. Here an example image using Farsi language and a localized week model for Iran. You can navigate through all Persian months, years or decades (by clicking on the header) or jump to current date (by clicking on the footer).

这篇关于如何实施波斯Calandar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆