最后一个工作日

时间:2017-10-15 23:07:33

标签: google-calendar-api icalendar

我想在特定日期之前的最后一个工作日(即不包括周末)在Google日历中设置每月定期活动(或提醒)。例如,如果10月22日星期日,我想要10月20日(星期五),但如果是星期二,我想要这个。

另外,假期也可以排除吗?

2 个答案:

答案 0 :(得分:0)

您可以通过为重复设置正确的<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" > <head id="j_idt2"> <link type="text/css" rel="stylesheet" href="/my-internal/javax.faces.resource/theme.css.jsf?ln=primefaces-afterwork" /> <link type="text/css" rel="stylesheet" href="/my-internal/javax.faces.resource/fa/font-awesome.css.jsf?ln=primefaces&amp;v=6.1.4" /> <link type="text/css" rel="stylesheet" href="/my-internal/javax.faces.resource/components.css.jsf?ln=primefaces&amp;v=6.1.4" /> <script type="text/javascript" src="/my-internal/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&amp;v=6.1.4"></script> <script type="text/javascript" src="/my-internal/javax.faces.resource/jquery/jquery-plugins.js.jsf?ln=primefaces&amp;v=6.1.4"></script> <script type="text/javascript" src="/my-internal/javax.faces.resource/core.js.jsf?ln=primefaces&amp;v=6.1.4"></script> <script type="text/javascript" src="/my-internal/javax.faces.resource/components.js.jsf?ln=primefaces&amp;v=6.1.4"></script> <script type="text/javascript" src="/my-internal/javax.faces.resource/validation/validation.js.jsf?ln=primefaces&amp;v=6.1.4"></script> <script type="text/javascript" src="/my-internal/javax.faces.resource/validation/beanvalidation.js.jsf?ln=primefaces&amp;v=6.1.4"></script> <script type="text/javascript">if(window.PrimeFaces){PrimeFaces.settings.locale='en';PrimeFaces.settings.validateEmptyFields=true;PrimeFaces.settings.considerEmptyStringNull=false;}</script> </head> <body> <p class="center">Test Address Validation</p> <div id="j_idt5" class="ui-panel ui-widget ui-widget-content ui-corner-all" data-widget="widget_j_idt5"> <div id="j_idt5_content" class="ui-panel-content ui-widget-content"> <form id="addressForm" name="addressForm" method="post" action="/my-internal/secure/test/test_validate_address.jsf" enctype="application/x-www-form-urlencoded" > <input type="hidden" name="addressForm" value="addressForm"/> <h1>Content</h1> <div id="j_idt6:uspsRecommendedAddressDlg" class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-shadow ui-hidden-container" > <div class="ui-dialog-titlebar ui-widget-header ui-helper-clearfix ui-corner-top"> <span id="j_idt6:uspsRecommendedAddressDlg_title" class="ui-dialog-title"> Header </span> </div> <div class="ui-dialog-content ui-widget-content"> <form id="j_idt6:selectAddressDlgForm" name="j_idt6:selectAddressDlgForm" method="post" action="/my-internal/secure/test/test_validate_address.jsf" enctype="application/x-www-form-urlencoded" > <input type="hidden" name="j_idt6:selectAddressDlgForm" value="j_idt6:selectAddressDlgForm" /> <div id="j_idt6:selectAddressPanel" class="ui-outputpanel ui-widget" > <div class="singleRow"> <h2>Title</h2> </div> </div> <input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:0" value="RY8/TyGpwk1TjZgz80VGyp90ZQqVcYGsd1ia0hXXpnQ4yM1H+REDJ4v4DrV9ZRnG56joTlETHstuAyd7vNcFvIaqZ8xF4NiPoV2nrTFqED18vmw5sve/X/v+bo68nYM09X83Bub3ZlxlbH5kiy6x7xds7E2PqBTJlyb+2E/xtzEM8I6RdFA6TFEFpPUrGCayJdwB8X5vdP5QYtbPb5t1FRmNs2Vb5Vzml3+eUQtY7k/tP2YIStJiy5eqi9y+La0SypXZ8gRDmCFGhtHb/Ec/t4H2uOhq7AhEuckLQzZWRX0qubupDgC8Zo4RGiSIWz5a2eZQ8uXN/u7b5mOAdkTFvznyatGLgx81zwXB/Iwfua3dcUI2pI2h1hSVhNb5QgL4PZifpjw17IoqXNDGg05hU7zI8ASrr38LN1eEHFdnsXrMy7CXyfTDs/4yZTCgh6+d09zpyVv/fmLDETY5YD7b9vCA28ewAjxqDk1P5pM6x0cd3IceC2hAf4geGYzAfIU7hUVj60vAI10FVDa+NZn8DszEKzjwO6g6ayBoubUHKwPfKGFAHSAVj/KOHffgmbl1ZzZwvCMeLib1q5eI4B9KYMgDTtXSNKUmiCTXu/DVCsml/oGq4CpsGk2dArmSRr9I" autocomplete="off" /> </form> </div> </div> <script id="j_idt6:uspsRecommendedAddressDlg_s" type="text/javascript" >$(function(){PrimeFaces.cw("Dialog","uspsRecommendedAddressDlg_j_idt6",{id:"j_idt6:uspsRecommendedAddressDlg",modal:true,appendTo:"@(body)",position:"300, 100"});});</script> <input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:1" value="oN5Hq9D5yY/QXngwqRN6EUbyPSNxZT8JOVp7hP++4nfmtIC0DaVJOgIAqw4eiBsumuuLl+Tq7NA7eGp0TCdOAw0Xj8hrAORd2Jcwreg7ubDAYg+qAGqcQMdoyIdGj8uQ50QLGpRavtMLmEr9nfFRz0Ni4YoYFadhYCLUVoX8qL9qwTcexRoODz8dAJ4DUUgJJGf8c0gfTKkvwDaJ0Jj7mM0Ckk4duT3XCbdL8Nvkl307z5QB3d6MLS+plAuh8MnZ0gB3e3X7YZFQjgB9YqRiGefr2ZFS/YYxPGE5a3dttHFFMN0H8sImke0p3xrT1EQD4askBvngO8xodWKlfITMHG0AFKuHpmr2QuYvlLY30ui9kxXwSBBr/slZfCuD1aNk+ZUpvR6F+EnohdqMGDtLCyYL03vQIifvRClPZ7cdreyYTtNlZdSaBnT3kE0I/G5N62ToR2ncVT+qBGNAKa2PzK4gHKonJCHRgSTPv5k6VVmeOrCURgtxvuy9QUvqSpG2y6aOwIBuC+HrMxAjDglIZrRxIEqJG+BcVvML6EGiSLTXJ4X5rZtjQ4oTYoBqnT8KhwhbGPRh/ems9eOT3W67dvn+6Pvnl5C9VWCC8ORYOtiTR5BGu4he5w7Cqz6SUzn+" autocomplete="off" /> </form> </div> </div> <script id="j_idt5_s" type="text/javascript">PrimeFaces.cw("Panel","widget_j_idt5",{id:"j_idt5"});</script> </body> </html> 来执行此操作。

您可以查看我已经回答的相关SO帖子,以便创建定期"Event every fourth Wednesday in August"和本教程:Create a repeating event on last day of each month on Google Calendar以获取代码实现参考。

RRULE

希望这有帮助。

答案 1 :(得分:0)

这将在每个月的22日生效。 RRULE:FREQ=MONTHLY;WKST=MO;BYMONTHDAY=20,21,22;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1