我使用ng-bootstrap Datepicker之类的东西:plnkr示例
<div class="input-group">
<input class="form-control" placeholder="yyyy-mm-dd"
name="dp" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker">
<div class="input-group-addon" (click)="d.toggle()" >
<img src="img/calendar-icon.svg" style="width: 1.2rem; height: 1rem; cursor: pointer;"/>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我想将占位符作为当前日期而不是yyyy-mm-dd.例如今天23.10.2016.这是可能的,或者我该怎么做.
我使用ng-bootstrap Datepicker之类的东西: plnkr示例
但现在选择日期后,我得到了对象
Model: {
"year": 2016,
"month": 10,
"day": 13
}
Run Code Online (Sandbox Code Playgroud)
但我想以2016-10-17的格式获得约会
我需要帮助.我有Windows服务,我需要在特定时间每小时运行一次这项服务,例如:09:05,10:05,11:05,....我的服务现在每小时开始,但从我开始这项服务的每个小时开始.那么我怎样才能实现我的需求呢.
我的代码:
public partial class Service1 : ServiceBase
{
System.Timers.Timer timer = new System.Timers.Timer();
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
this.WriteToFile("Starting Service {0}");
timer.Elapsed += new ElapsedEventHandler(OnElapsedTime);
timer.Interval = 60000;
timer.Enabled = true;
}
protected override void OnStop()
{
timer.Enabled = false;
this.WriteToFile("Stopping Service {0}");
}
private void OnElapsedTime(object source, ElapsedEventArgs e)
{
this.WriteToFile(" interval start {0}");
} }
Run Code Online (Sandbox Code Playgroud)