本文整理汇总了Java中org.joda.time.DateTimeConstants.TUESDAY属性的典型用法代码示例。如果您正苦于以下问题:Java DateTimeConstants.TUESDAY属性的具体用法?Java DateTimeConstants.TUESDAY怎么用?Java DateTimeConstants.TUESDAY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.joda.time.DateTimeConstants
的用法示例。
在下文中一共展示了DateTimeConstants.TUESDAY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDayOfWeekTimeFlag
public static long getDayOfWeekTimeFlag(int dayOfWeek) {
dayOfWeek = (dayOfWeek - 1) % 7 + 1;
switch (dayOfWeek) {
case DateTimeConstants.SUNDAY:
return FLAG_SUNDAY;
case DateTimeConstants.MONDAY:
return FLAG_MONDAY;
case DateTimeConstants.SATURDAY:
return FLAG_SATURDAY;
case DateTimeConstants.WEDNESDAY:
return FLAG_WEDNESDAY;
case DateTimeConstants.TUESDAY:
return FLAG_TUESDAY;
case DateTimeConstants.THURSDAY:
return FLAG_THURSDAY;
case DateTimeConstants.FRIDAY:
return FLAG_FRIDAY;
}
throw new IllegalArgumentException("dayOfWeek = " + dayOfWeek);
}
示例2: isMarketOpen
private boolean isMarketOpen(DateTime dateTime) {
checkNotNull(dateTime);
checkNotNullOrEmpty(forexCloseTime);
checkNotNullOrEmpty(forexOpenTime);
int dayOfWeek = dateTime.dayOfWeek().get();
switch (dayOfWeek) {
case DateTimeConstants.SATURDAY:
return false;
case DateTimeConstants.FRIDAY:
DateTime marketCloseTime = DateTime.parse(forexCloseTime, DATE_TIME_FORMATTER)
.plus(dateTime.withTimeAtStartOfDay().getMillis());
return dateTime.compareTo(marketCloseTime) < 0;
case DateTimeConstants.SUNDAY:
DateTime marketOpenTime = DateTime.parse(forexOpenTime, DATE_TIME_FORMATTER)
.plus(dateTime.withTimeAtStartOfDay().getMillis());
return dateTime.compareTo(marketOpenTime) >= 0;
case DateTimeConstants.MONDAY:
case DateTimeConstants.TUESDAY:
case DateTimeConstants.WEDNESDAY:
case DateTimeConstants.THURSDAY:
return true;
default:
throw new IllegalArgumentException(
String.format("Unsupported day of the week [%d]", dayOfWeek));
}
}
示例3: getMonthlyExpirations
/**
* Gets all expirations for the current symbol and then excludes dates that are not part of the monthly expirations.
* Dates are 15th - 22nd, if it's the 22nd, then the 22nd has to be a Sat
*
* There are some expirations on Friday and Sat where 1 of the 2 only has a few options available.
*
* @return monthly expirations
*/
public List<Date> getMonthlyExpirations() {
List<Date> monthlyExpirations = new ArrayList<Date>();
List<Date> allExpirations = getExpirations();
for (Date date : allExpirations) {
DateTime jDate = new DateTime(date);
if (jDate.dayOfMonth().get() >= 15 && jDate.dayOfMonth().get() <= 22) {
if ((jDate.dayOfMonth().get() == 22 && jDate.getDayOfWeek() != DateTimeConstants.SATURDAY)
|| jDate.getDayOfWeek() == DateTimeConstants.SUNDAY
|| jDate.getDayOfWeek() == DateTimeConstants.MONDAY
|| jDate.getDayOfWeek() == DateTimeConstants.TUESDAY
|| jDate.getDayOfWeek() == DateTimeConstants.WEDNESDAY
|| jDate.getDayOfWeek() == DateTimeConstants.THURSDAY
) {
// skip
} else {
//System.out.println(jDate.toString() + " - " + jDate.getDayOfWeek());
monthlyExpirations.add(date);
}
}
}
return monthlyExpirations;
}
示例4: execute
@Override
public void execute(MessageReceivedEvent event, String[] args) {
DateTime current = new DateTime(DateTimeZone.forID("America/Montreal"));
while (current.getDayOfWeek() != DateTimeConstants.TUESDAY) {
current = current.minusDays(1);
}
int weeks = Weeks.weeksBetween(Utils.startDateMythicPlus, current).getWeeks();
String[] weekAffixes = Utils.mythicPlusAffixes[weeks % 12];
event.getChannel().sendMessage(Utils.createMythicEmbed(bot, event.getGuild(), weekAffixes).build()).queue();
}
示例5: execute
@Override
public void execute(MessageReceivedEvent event, String[] args) {
DateTime current = new DateTime(DateTimeZone.forID("America/Montreal"));
if (current.getDayOfWeek() == DateTimeConstants.TUESDAY) {
current = current.plusDays(1);
}
while (current.getDayOfWeek() != DateTimeConstants.TUESDAY) {
current = current.plusDays(1);
}
int weeks = Weeks.weeksBetween(Utils.startDateMythicPlus, current).getWeeks();
String[] weekAffixes = Utils.mythicPlusAffixes[weeks % 12];
event.getChannel().sendMessage(Utils.createMythicEmbed(bot, event.getGuild(), weekAffixes).build()).queue();
}
示例6: getWeekday
/**
* 计算当前是星期几
* 返回 星期x
*/
public static String getWeekday(Date date)
{
DateTime dt = new DateTime(date);
String weekday = "";
//星期
switch(dt.getDayOfWeek()) {
case DateTimeConstants.SUNDAY:
weekday = "星期日";
break;
case DateTimeConstants.MONDAY:
weekday = "星期一";
break;
case DateTimeConstants.TUESDAY:
weekday = "星期二";
break;
case DateTimeConstants.WEDNESDAY:
weekday = "星期三";
break;
case DateTimeConstants.THURSDAY:
weekday = "星期四";
break;
case DateTimeConstants.FRIDAY:
weekday = "星期五";
break;
case DateTimeConstants.SATURDAY:
weekday = "星期六";
break;
}
return weekday;
}
示例7: getWeekday2
/** 返回 周x */
public static String getWeekday2(Date date)
{
DateTime dt = new DateTime(date);
String weekday = "";
//星期
switch(dt.getDayOfWeek()) {
case DateTimeConstants.SUNDAY:
weekday = "周日";
break;
case DateTimeConstants.MONDAY:
weekday = "周一";
break;
case DateTimeConstants.TUESDAY:
weekday = "周二";
break;
case DateTimeConstants.WEDNESDAY:
weekday = "周三";
break;
case DateTimeConstants.THURSDAY:
weekday = "周四";
break;
case DateTimeConstants.FRIDAY:
weekday = "周五";
break;
case DateTimeConstants.SATURDAY:
weekday = "周六";
break;
}
return weekday;
}
示例8: getEnWeekday
/** 返回 SUN,MON,TUE*/
public static String getEnWeekday(Date date)
{
DateTime dt = new DateTime(date);
String weekday = "";
//星期
switch(dt.getDayOfWeek()) {
case DateTimeConstants.SUNDAY:
weekday = "SUN";
break;
case DateTimeConstants.MONDAY:
weekday = "MON";
break;
case DateTimeConstants.TUESDAY:
weekday = "TUE";
break;
case DateTimeConstants.WEDNESDAY:
weekday = "WED";
break;
case DateTimeConstants.THURSDAY:
weekday = "THU";
break;
case DateTimeConstants.FRIDAY:
weekday = "FRI";
break;
case DateTimeConstants.SATURDAY:
weekday = "SAT";
break;
}
return weekday;
}
示例9: getMsgFormatTime
/**
* 得到仿微信日期格式输出
*
* @param msgTimeMillis
* @return
*/
public static String getMsgFormatTime(long msgTimeMillis) {
DateTime nowTime = new DateTime();
// LogUtils.sf("nowTime = " + nowTime);
DateTime msgTime = new DateTime(msgTimeMillis);
// LogUtils.sf("msgTime = " + msgTime);
int days = Math.abs(Days.daysBetween(msgTime, nowTime).getDays());
// LogUtils.sf("days = " + days);
if (days < 1) {
//早上、下午、晚上 1:40
return getTime(msgTime);
} else if (days == 1) {
//昨天
return "昨天 " + getTime(msgTime);
} else if (days <= 7) {
//星期
switch (msgTime.getDayOfWeek()) {
case DateTimeConstants.SUNDAY:
return "周日 " + getTime(msgTime);
case DateTimeConstants.MONDAY:
return "周一 " + getTime(msgTime);
case DateTimeConstants.TUESDAY:
return "周二 " + getTime(msgTime);
case DateTimeConstants.WEDNESDAY:
return "周三 " + getTime(msgTime);
case DateTimeConstants.THURSDAY:
return "周四 " + getTime(msgTime);
case DateTimeConstants.FRIDAY:
return "周五 " + getTime(msgTime);
case DateTimeConstants.SATURDAY:
return "周六 " + getTime(msgTime);
}
return "";
} else {
//12月22日
return msgTime.toString("MM月dd日 " + getTime(msgTime));
}
}
示例10: setup
@Before
public void setup() throws Exception {
inject.setStaticField(Ofy.class, "clock", clock);
action = new RdeStagingAction();
action.clock = clock;
action.mrRunner = makeDefaultRunner();
action.lenient = false;
action.reducer = new RdeStagingReducer(
new TaskEnqueuer(new Retrier(new SystemSleeper(), 1)), // taskEnqueuer
new FakeLockHandler(true),
0, // gcsBufferSize
"rde-bucket", // bucket
31337, // ghostrydeBufferSize
Duration.standardHours(1), // lockTimeout
PgpHelper.convertPublicKeyToBytes(encryptKey), // stagingKeyBytes
false); // lenient
action.pendingDepositChecker = new PendingDepositChecker();
action.pendingDepositChecker.brdaDayOfWeek = DateTimeConstants.TUESDAY;
action.pendingDepositChecker.brdaInterval = Duration.standardDays(7);
action.pendingDepositChecker.clock = clock;
action.pendingDepositChecker.rdeInterval = Duration.standardDays(1);
action.response = response;
action.transactionCooldown = Duration.ZERO;
action.directory = Optional.empty();
action.modeStrings = ImmutableSet.of();
action.tlds = ImmutableSet.of();
action.watermarks = ImmutableSet.of();
action.revision = Optional.empty();
}
示例11: parseShowReleaseWeekDay
/**
* Converts US week day string to {@link org.joda.time.DateTimeConstants} day.
*
* <p> Returns -1 if no conversion is possible and 0 if it is "Daily".
*/
public static int parseShowReleaseWeekDay(String day) {
if (day == null || day.length() == 0) {
return -1;
}
// catch Monday through Sunday
switch (day) {
case "Monday":
return DateTimeConstants.MONDAY;
case "Tuesday":
return DateTimeConstants.TUESDAY;
case "Wednesday":
return DateTimeConstants.WEDNESDAY;
case "Thursday":
return DateTimeConstants.THURSDAY;
case "Friday":
return DateTimeConstants.FRIDAY;
case "Saturday":
return DateTimeConstants.SATURDAY;
case "Sunday":
return DateTimeConstants.SUNDAY;
case "Daily":
return 0;
}
// no match
return -1;
}
示例12: dayOfWeekToString
public static String dayOfWeekToString(Integer dayOfWeek) {
if (dayOfWeek==null) return "unspecified day";
else if (dayOfWeek==DateTimeConstants.MONDAY) return "Monday"; // 1
else if (dayOfWeek==DateTimeConstants.TUESDAY) return "Tuesday"; // 2
else if (dayOfWeek==DateTimeConstants.WEDNESDAY) return "Wednesday"; // 3
else if (dayOfWeek==DateTimeConstants.THURSDAY) return "Thursday"; // 4
else if (dayOfWeek==DateTimeConstants.FRIDAY) return "Friday"; // 5
else if (dayOfWeek==DateTimeConstants.SATURDAY) return "Saturday"; // 6
else if (dayOfWeek==DateTimeConstants.SUNDAY) return "Sunday"; // 7
return "invalid day of the week "+dayOfWeek;
}
示例13: provideBrdaDayOfWeek
/** @see google.registry.rde.BrdaCopyAction */
@Provides
@Config("brdaDayOfWeek")
public static int provideBrdaDayOfWeek() {
return DateTimeConstants.TUESDAY;
}
示例14: getClasses
private ArrayList<StandardClass> getClasses() {
switch (day) {
case DateTimeConstants.MONDAY:
return DataSingleton.getInstance().getMondayClasses();
case DateTimeConstants.TUESDAY:
return DataSingleton.getInstance().getTuesdayClasses();
case DateTimeConstants.WEDNESDAY:
return DataSingleton.getInstance().getWednesdayClasses();
case DateTimeConstants.THURSDAY:
return DataSingleton.getInstance().getThursdayClasses();
case DateTimeConstants.FRIDAY:
return DataSingleton.getInstance().getFridayClasses();
case DateTimeConstants.SATURDAY:
return DataSingleton.getInstance().getSaturdayClasses();
case DateTimeConstants.SUNDAY:
return DataSingleton.getInstance().getSundayClasses();
default:
return null;
}
}
示例15: getClassesArrayListOfDay
public static ArrayList<StandardClass> getClassesArrayListOfDay(int day) {
switch (day) {
case DateTimeConstants.MONDAY:
return DataSingleton.getInstance().getMondayClasses();
case DateTimeConstants.TUESDAY:
return DataSingleton.getInstance().getTuesdayClasses();
case DateTimeConstants.WEDNESDAY:
return DataSingleton.getInstance().getWednesdayClasses();
case DateTimeConstants.THURSDAY:
return DataSingleton.getInstance().getThursdayClasses();
case DateTimeConstants.FRIDAY:
return DataSingleton.getInstance().getFridayClasses();
case DateTimeConstants.SATURDAY:
return DataSingleton.getInstance().getSaturdayClasses();
case DateTimeConstants.SUNDAY:
return DataSingleton.getInstance().getSundayClasses();
default:
return new ArrayList<>();
}
}