How can I get a day off next week?

secret35

How can I get a day off next week from android?

The hour I set for Friday and Sunday is over. I want you to go to friday next week.

This is my code;

/**
 * Set Friday Alarm
 */
getNotfDay.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);
getNotfDay.set(Calendar.HOUR_OF_DAY, myCustomTime.getHours());
getNotfDay.set(Calendar.MINUTE, myCustomTime.getMinutes());
getNotfDay.set(Calendar.SECOND, myCustomTime.getSeconds());

/**
 * 30 minute later from alarm time
 */
getNotfDay.add(Calendar.MINUTE, 30);

/**
 * If Friday time before currently time is set Sunday
 */
if (getNotfDay.getTime().before(Utils.longToDate(System.currentTimeMillis()))) {
    getNotfDay.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
    getNotfDay.set(Calendar.HOUR_OF_DAY, myCustomTime2.getHours());
    getNotfDay.set(Calendar.MINUTE, myCustomTime2.getMinutes());
}

Utils.java

public static Date longToDate(long timeMillis){
  return new Date(timeMillis);
}
rhari

You can just add 7 days (1 week).

//Set to this week's Friday
getNotfDay.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);
getNotfDay.set(Calendar.HOUR_OF_DAY, myCustomTime.getHours());
getNotfDay.set(Calendar.MINUTE, myCustomTime.getMinutes());
getNotfDay.set(Calendar.SECOND, myCustomTime.getSeconds());
getNotfDay.add(Calendar.DATE, 7);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get the date of next specified day of week

From Dev

How can I get one wallpaper for each day of the week?

From Dev

How can I get one wallpaper for each day of the week?

From Dev

How can I get 'day of week' for the 'Friday' only?

From Dev

Laravel or php I have a week number of a month and a day, how can i get the date of these..?

From Dev

How Can i get DateArray of current Running Week With Month a Day And Month in Asp.net C#

From Dev

Get the next LocalDateTime for a given day of week

From Dev

How can I display the day of the week, (I have the highest value)?

From Java

How can I get the DateTime for the start of the week?

From Dev

How can I get the previous week in Python?

From Dev

How can I get the previous week in Python?

From Dev

How can I construct a Locale with a custom first day of week?

From Dev

How can I determine whether a day lies within the last week or not?

From Dev

How can I check for a specific day of the week using NSDate in Swift?

From Dev

How can I clean up this code to convert a date into a day of the week?

From Dev

How can I set the day of the week as a variable in Swift?

From Dev

How can I change the first day of week in Swift

From Java

How do I get the day of week given a date?

From Dev

How do I get the Day of Week order to start with Monday

From Dev

How Get Start Day of Week?

From Dev

Android week View how can we Get all days of a next and previous week

From Dev

How to get first day of week when i know week number in ISO 8601

From Dev

Spinner contains week days, how can I select the default day depending on the device day

From Dev

Protractor: How can I get the next tag

From Dev

PHP get same day of same week next year

From Dev

Trying to get the date next month that is in the same week on the same day

From Dev

PHP Get year of last week given one day of next year

From Dev

How can I get rid off a character to get the desired output

From Dev

Can I get a Jenkins trigger to run every first week day of every month?

Related Related

  1. 1

    How to get the date of next specified day of week

  2. 2

    How can I get one wallpaper for each day of the week?

  3. 3

    How can I get one wallpaper for each day of the week?

  4. 4

    How can I get 'day of week' for the 'Friday' only?

  5. 5

    Laravel or php I have a week number of a month and a day, how can i get the date of these..?

  6. 6

    How Can i get DateArray of current Running Week With Month a Day And Month in Asp.net C#

  7. 7

    Get the next LocalDateTime for a given day of week

  8. 8

    How can I display the day of the week, (I have the highest value)?

  9. 9

    How can I get the DateTime for the start of the week?

  10. 10

    How can I get the previous week in Python?

  11. 11

    How can I get the previous week in Python?

  12. 12

    How can I construct a Locale with a custom first day of week?

  13. 13

    How can I determine whether a day lies within the last week or not?

  14. 14

    How can I check for a specific day of the week using NSDate in Swift?

  15. 15

    How can I clean up this code to convert a date into a day of the week?

  16. 16

    How can I set the day of the week as a variable in Swift?

  17. 17

    How can I change the first day of week in Swift

  18. 18

    How do I get the day of week given a date?

  19. 19

    How do I get the Day of Week order to start with Monday

  20. 20

    How Get Start Day of Week?

  21. 21

    Android week View how can we Get all days of a next and previous week

  22. 22

    How to get first day of week when i know week number in ISO 8601

  23. 23

    Spinner contains week days, how can I select the default day depending on the device day

  24. 24

    Protractor: How can I get the next tag

  25. 25

    PHP get same day of same week next year

  26. 26

    Trying to get the date next month that is in the same week on the same day

  27. 27

    PHP Get year of last week given one day of next year

  28. 28

    How can I get rid off a character to get the desired output

  29. 29

    Can I get a Jenkins trigger to run every first week day of every month?

HotTag

Archive